Mercurial > hgsubversion
comparison utility_commands.py @ 149:04800fda7af5
rebase: preserve local branch names.
Note: this commit introduces a dependency on Mercurial 1.1.1 or later.
| author | Augie Fackler <durin42@gmail.com> |
|---|---|
| date | Mon, 22 Dec 2008 21:20:10 -0600 |
| parents | ed42f6e5705a |
| children | 58ae90a65f41 |
comparison
equal
deleted
inserted
replaced
| 148:0c5f6420a8b5 | 149:04800fda7af5 |
|---|---|
| 84 This moves a line of development from making its own head to the top of | 84 This moves a line of development from making its own head to the top of |
| 85 Subversion development, linearizing the changes. In order to make sure you | 85 Subversion development, linearizing the changes. In order to make sure you |
| 86 rebase on top of the current top of Subversion work, you should probably run | 86 rebase on top of the current top of Subversion work, you should probably run |
| 87 'hg svn pull' before running this. | 87 'hg svn pull' before running this. |
| 88 """ | 88 """ |
| 89 def extrafn(ctx, extra): | |
| 90 """defined here so we can add things easily. | |
| 91 """ | |
| 92 extra['branch'] = ctx.branch() | |
| 89 hge = hg_delta_editor.HgChangeReceiver(hg_repo_path, | 93 hge = hg_delta_editor.HgChangeReceiver(hg_repo_path, |
| 90 ui_=ui) | 94 ui_=ui) |
| 91 svn_commit_hashes = dict(zip(hge.revmap.itervalues(), | 95 svn_commit_hashes = dict(zip(hge.revmap.itervalues(), |
| 92 hge.revmap.iterkeys())) | 96 hge.revmap.iterkeys())) |
| 93 o_r = util.outgoing_revisions(ui, repo, hge, svn_commit_hashes) | 97 o_r = util.outgoing_revisions(ui, repo, hge, svn_commit_hashes) |
| 113 if parent_rev == target_rev: | 117 if parent_rev == target_rev: |
| 114 ui.status('Already up to date!\n') | 118 ui.status('Already up to date!\n') |
| 115 return 0 | 119 return 0 |
| 116 # TODO this is really hacky, there must be a more direct way | 120 # TODO this is really hacky, there must be a more direct way |
| 117 return rebase.rebase(ui, repo, dest=node.hex(target_rev.node()), | 121 return rebase.rebase(ui, repo, dest=node.hex(target_rev.node()), |
| 118 base=node.hex(repo.parents()[0].node())) | 122 base=node.hex(repo.parents()[0].node()), |
| 123 extrafn=extrafn) | |
| 119 | 124 |
| 120 | 125 |
| 121 @util.register_subcommand('outgoing') | 126 @util.register_subcommand('outgoing') |
| 122 def show_outgoing_to_svn(ui, repo, hg_repo_path, **opts): | 127 def show_outgoing_to_svn(ui, repo, hg_repo_path, **opts): |
| 123 """Commit the current revision and any required parents back to svn. | 128 """Commit the current revision and any required parents back to svn. |
