Mercurial > hgsubversion
comparison utility_commands.py @ 150:58ae90a65f41
push: Improved the rebasing logic for push so that it doesn't break with
keeping branch names during rebase.
author | Augie Fackler <durin42@gmail.com> |
---|---|
date | Mon, 22 Dec 2008 21:21:11 -0600 |
parents | 04800fda7af5 |
children | 1fde85a10f9e |
comparison
equal
deleted
inserted
replaced
149:04800fda7af5 | 150:58ae90a65f41 |
---|---|
76 ui.status('Working copy seems to have no parent svn revision.\n') | 76 ui.status('Working copy seems to have no parent svn revision.\n') |
77 return 0 | 77 return 0 |
78 | 78 |
79 | 79 |
80 @util.register_subcommand('rebase') | 80 @util.register_subcommand('rebase') |
81 def rebase_commits(ui, repo, hg_repo_path, **opts): | 81 def rebase_commits(ui, repo, hg_repo_path, extrafn=None, **opts): |
82 """Rebases current unpushed revisions onto Subversion head | 82 """Rebases current unpushed revisions onto Subversion head |
83 | 83 |
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): | 89 if extrafn is None: |
90 """defined here so we can add things easily. | 90 def extrafn2(ctx, extra): |
91 """ | 91 """defined here so we can add things easily. |
92 extra['branch'] = ctx.branch() | 92 """ |
93 extra['branch'] = ctx.branch() | |
94 extrafn = extrafn2 | |
93 hge = hg_delta_editor.HgChangeReceiver(hg_repo_path, | 95 hge = hg_delta_editor.HgChangeReceiver(hg_repo_path, |
94 ui_=ui) | 96 ui_=ui) |
95 svn_commit_hashes = dict(zip(hge.revmap.itervalues(), | 97 svn_commit_hashes = dict(zip(hge.revmap.itervalues(), |
96 hge.revmap.iterkeys())) | 98 hge.revmap.iterkeys())) |
97 o_r = util.outgoing_revisions(ui, repo, hge, svn_commit_hashes) | 99 o_r = util.outgoing_revisions(ui, repo, hge, svn_commit_hashes) |