Mercurial > hgsubversion
comparison cmdutil.py @ 254:9ba31af57e4b
Move utility_commands.find_wc_parent_rev() to cmdutil.parentrev().
| author | Dirkjan Ochtman <dirkjan@ochtman.nl> |
|---|---|
| date | Fri, 10 Apr 2009 17:29:45 +0200 |
| parents | 28d0ee605308 |
| children | 7932d098cb5f |
comparison
equal
deleted
inserted
replaced
| 253:c3d5c4ae9c7c | 254:9ba31af57e4b |
|---|---|
| 3 | 3 |
| 4 from mercurial import util as hgutil | 4 from mercurial import util as hgutil |
| 5 | 5 |
| 6 from svn import core | 6 from svn import core |
| 7 | 7 |
| 8 import util | |
| 8 import svnwrap | 9 import svnwrap |
| 9 import svnexternals | 10 import svnexternals |
| 10 | 11 |
| 11 | 12 |
| 12 b_re = re.compile(r'^\+\+\+ b\/([^\n]*)', re.MULTILINE) | 13 b_re = re.compile(r'^\+\+\+ b\/([^\n]*)', re.MULTILINE) |
| 30 diff = b_re.sub(r'+++ \1' + '\t(working copy)', diff) | 31 diff = b_re.sub(r'+++ \1' + '\t(working copy)', diff) |
| 31 diff = devnull_re.sub(r'\1 /dev/null' '\t(working copy)', diff) | 32 diff = devnull_re.sub(r'\1 /dev/null' '\t(working copy)', diff) |
| 32 | 33 |
| 33 diff = header_re.sub(r'Index: \1' + '\n' + ('=' * 67), diff) | 34 diff = header_re.sub(r'Index: \1' + '\n' + ('=' * 67), diff) |
| 34 return diff | 35 return diff |
| 36 | |
| 37 | |
| 38 def parentrev(ui, repo, hge, svn_commit_hashes): | |
| 39 """Find the svn parent revision of the repo's dirstate. | |
| 40 """ | |
| 41 workingctx = repo.parents()[0] | |
| 42 outrev = util.outgoing_revisions(ui, repo, hge, svn_commit_hashes, | |
| 43 workingctx.node()) | |
| 44 if outrev: | |
| 45 workingctx = repo[outrev[-1]].parents()[0] | |
| 46 return workingctx | |
| 35 | 47 |
| 36 | 48 |
| 37 def replay_convert_rev(hg_editor, svn, r): | 49 def replay_convert_rev(hg_editor, svn, r): |
| 38 hg_editor.set_current_rev(r) | 50 hg_editor.set_current_rev(r) |
| 39 svn.get_replay(r.revnum, hg_editor) | 51 svn.get_replay(r.revnum, hg_editor) |
