Skip to content

Commit

Permalink
Open Source :)
Browse files Browse the repository at this point in the history
  • Loading branch information
danieledapo committed Jul 26, 2016
1 parent 87d60d1 commit a19e1a7
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 17 deletions.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2016 Develer srl

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ reason this script is not meant to be used with the old Windows XP.

## How to Install
```bash
$ pip install git+ssh://gitlab.com/develer/svn-migration-tools.git
$ pip install https://github.com/develersrl/git-externals/archive/master.zip
```

## Gittify
Expand All @@ -32,9 +32,9 @@ This script can work in 3 modes:

Usage:
```bash
$ gittify -A authors-file.txt file:///var/lib/svn/foo file:///var/lib/svn/bar &> clone_log
$ gittify -A authors-file.txt --fetch &> fetch_log
$ gittify --finalize --git-server=https://git.foo.com/ &> conversion_log
$ gittify -A authors-file.txt clone file:///var/lib/svn/foo file:///var/lib/svn/bar
$ gittify -A authors-file.txt fetch
$ gittify finalize --git-server=https://git.foo.com/
```

However ```gittify --help``` is useful as well.
Expand Down
20 changes: 7 additions & 13 deletions git_externals/gittify.py
Original file line number Diff line number Diff line change
Expand Up @@ -547,9 +547,14 @@ def check_call(command):
@click.option('--externals-filename', default='git_externals.json')
@click.option('--mismatched-refs-filename', default='mismatched_ext.json')
@click.option('--dry-run', is_flag=True)
@click.option('--git-server', default=None)
@click.pass_context
def finalize(ctx, root, path, ignore_not_found, externals_filename, mismatched_refs_filename,
dry_run, git=git, checkout=checkout, check_call=check_call):
dry_run, git_server, git=git, checkout=checkout, check_call=check_call):

if git_server is None:
error('git-server is required')

gitsvn_repo = ctx.obj['gitsvn_dir'] / (path + GITSVN_EXT)
git_repo = ctx.obj['finalize_dir'] / (path + GIT_EXT)
info('Finalize {}'.format(git_repo))
Expand All @@ -568,21 +573,10 @@ def add_ignores(*args):

config = {'super_repos': ['packages/', 'vendor/'],
'svn_server': root,
'git_server': 'foo',
'git_server': git_server,
'basedir': str(ctx.obj['gitsvn_dir']),
}

def prefix(config, path):
if path.startswith('/packages/'):
git_server = 'packages/'
elif path.startswith('/vendor/'):
git_server = 'vendor/'
else:
git_server = 'foo'
config = dict(config)
config['git_server'] = git_server
return config

def add_ignores(git_ignore):
with open('.gitignore', 'wt') as fp:
fp.write(git_ignore)
Expand Down

0 comments on commit a19e1a7

Please sign in to comment.