comparison utility_commands.py @ 230:4c3bad24f950

rebase: cleanup slightly.
author Augie Fackler <durin42@gmail.com>
date Mon, 30 Mar 2009 16:11:45 -0500
parents f71af18c4379
children 33e885f5f86a
comparison
equal deleted inserted replaced
229:7f20914e52e8 230:4c3bad24f950
128 ui.status('Working copy seems to have no parent svn revision.\n') 128 ui.status('Working copy seems to have no parent svn revision.\n')
129 return 0 129 return 0
130 print_parent_revision = util.register_subcommand('parent')(print_parent_revision) 130 print_parent_revision = util.register_subcommand('parent')(print_parent_revision)
131 131
132 132
133 def rebase_commits(ui, repo, hg_repo_path, extrafn=None, sourcerev=None, **opts): 133 def rebase_commits(ui, repo, extrafn=None, sourcerev=None, **opts):
134 """rebase current unpushed revisions onto the Subversion head 134 """rebase current unpushed revisions onto the Subversion head
135 135
136 This moves a line of development from making its own head to the top of 136 This moves a line of development from making its own head to the top of
137 Subversion development, linearizing the changes. In order to make sure you 137 Subversion development, linearizing the changes. In order to make sure you
138 rebase on top of the current top of Subversion work, you should probably run 138 rebase on top of the current top of Subversion work, you should probably run
144 """ 144 """
145 extra['branch'] = ctx.branch() 145 extra['branch'] = ctx.branch()
146 extrafn = extrafn2 146 extrafn = extrafn2
147 if sourcerev is None: 147 if sourcerev is None:
148 sourcerev = repo.parents()[0].node() 148 sourcerev = repo.parents()[0].node()
149 hge = hg_delta_editor.HgChangeReceiver(hg_repo_path, 149 hge = hg_delta_editor.HgChangeReceiver(repo=repo)
150 ui_=ui)
151 svn_commit_hashes = dict(zip(hge.revmap.itervalues(), 150 svn_commit_hashes = dict(zip(hge.revmap.itervalues(),
152 hge.revmap.iterkeys())) 151 hge.revmap.iterkeys()))
153 o_r = util.outgoing_revisions(ui, repo, hge, svn_commit_hashes, sourcerev=sourcerev) 152 o_r = util.outgoing_revisions(ui, repo, hge, svn_commit_hashes, sourcerev=sourcerev)
154 if not o_r: 153 if not o_r:
155 ui.status('Nothing to rebase!\n') 154 ui.status('Nothing to rebase!\n')