Mercurial > hgsubversion
comparison fetch_command.py @ 300:4aba7542f6a9
Various cleanups, cosmetics and removal of superfluous assertions.
| author | Dan Villiom Podlaski Christiansen <danchr@gmail.com> |
|---|---|
| date | Fri, 27 Mar 2009 03:16:21 +0100 |
| parents | 9be04de434ed |
| children | 79440ed81011 |
comparison
equal
deleted
inserted
replaced
| 299:3e27514d575c | 300:4aba7542f6a9 |
|---|---|
| 26 authors=None, | 26 authors=None, |
| 27 filemap=None, | 27 filemap=None, |
| 28 **opts): | 28 **opts): |
| 29 """pull new revisions from Subversion | 29 """pull new revisions from Subversion |
| 30 """ | 30 """ |
| 31 | |
| 31 svn_url = util.normalize_url(svn_url) | 32 svn_url = util.normalize_url(svn_url) |
| 32 old_encoding = merc_util._encoding | 33 old_encoding = merc_util._encoding |
| 33 merc_util._encoding = 'UTF-8' | 34 merc_util._encoding = 'UTF-8' |
| 34 skipto_rev=int(skipto_rev) | 35 skipto_rev=int(skipto_rev) |
| 36 | |
| 35 have_replay = not stupid | 37 have_replay = not stupid |
| 36 if have_replay and not callable( | 38 if have_replay and not callable( |
| 37 delta.svn_txdelta_apply(None, None, None)[0]): #pragma: no cover | 39 delta.svn_txdelta_apply(None, None, None)[0]): #pragma: no cover |
| 38 ui.status('You are using old Subversion SWIG bindings. Replay will not' | 40 ui.status('You are using old Subversion SWIG bindings. Replay will not' |
| 39 ' work until you upgrade to 1.5.0 or newer. Falling back to' | 41 ' work until you upgrade to 1.5.0 or newer. Falling back to' |
| 40 ' a slower method that may be buggier. Please upgrade, or' | 42 ' a slower method that may be buggier. Please upgrade, or' |
| 41 ' contribute a patch to use the ctypes bindings instead' | 43 ' contribute a patch to use the ctypes bindings instead' |
| 42 ' of SWIG.\n') | 44 ' of SWIG.\n') |
| 43 have_replay = False | 45 have_replay = False |
| 44 initializing_repo = False | |
| 45 svn = svnwrap.SubversionRepo(svn_url, username=merc_util.getuser()) | 46 svn = svnwrap.SubversionRepo(svn_url, username=merc_util.getuser()) |
| 46 author_host = "@%s" % svn.uuid | 47 author_host = "@%s" % svn.uuid |
| 47 tag_locations = tag_locations.split(',') | 48 tag_locations = tag_locations.split(',') |
| 48 hg_editor = hg_delta_editor.HgChangeReceiver(hg_repo_path, | 49 hg_editor = hg_delta_editor.HgChangeReceiver(hg_repo_path, |
| 49 ui_=ui, | 50 ui_=ui, |
| 50 subdir=svn.subdir, | 51 subdir=svn.subdir, |
| 51 author_host=author_host, | 52 author_host=author_host, |
| 52 tag_locations=tag_locations, | 53 tag_locations=tag_locations, |
| 53 authors=authors, | 54 authors=authors, |
| 54 filemap=filemap) | 55 filemap=filemap) |
| 56 | |
| 55 if os.path.exists(hg_editor.uuid_file): | 57 if os.path.exists(hg_editor.uuid_file): |
| 58 initializing_repo = False | |
| 56 uuid = open(hg_editor.uuid_file).read() | 59 uuid = open(hg_editor.uuid_file).read() |
| 57 assert uuid == svn.uuid | 60 assert uuid == svn.uuid |
| 58 start = hg_editor.last_known_revision() | 61 start = hg_editor.last_known_revision() |
| 59 else: | 62 else: |
| 60 open(hg_editor.uuid_file, 'w').write(svn.uuid) | 63 open(hg_editor.uuid_file, 'w').write(svn.uuid) |
