comparison push_cmd.py @ 151:2decec74ad0c

push: Use a better method for finding the outgoing revisions.
author Augie Fackler <durin42@gmail.com>
date Mon, 22 Dec 2008 21:21:39 -0600
parents 58ae90a65f41
children 1fde85a10f9e
comparison
equal deleted inserted replaced
150:58ae90a65f41 151:2decec74ad0c
1 from mercurial import util as merc_util 1 from mercurial import util as merc_util
2 from mercurial import hg 2 from mercurial import hg
3 from mercurial import node
3 from svn import core 4 from svn import core
4 5
5 import util 6 import util
6 import hg_delta_editor 7 import hg_delta_editor
7 import svnwrap 8 import svnwrap
69 return 70 return
70 extra['branch'] = ctx.branch() 71 extra['branch'] = ctx.branch()
71 hg.clean(repo, needs_transplant) 72 hg.clean(repo, needs_transplant)
72 utility_commands.rebase_commits(ui, repo, hg_repo_path, extrafn=extrafn, **opts) 73 utility_commands.rebase_commits(ui, repo, hg_repo_path, extrafn=extrafn, **opts)
73 repo = hg.repository(ui, hge.path) 74 repo = hg.repository(ui, hge.path)
74 if needs_transplant in outgoing: 75 for child in repo[replacement.node()].children():
75 hg.clean(repo, repo['tip'].node()) 76 rebasesrc = node.bin(child.extra().get('rebase_source', node.hex(node.nullid)))
76 hge = hg_delta_editor.HgChangeReceiver(hg_repo_path, ui_=ui) 77 if rebasesrc in outgoing:
77 svn_commit_hashes = dict(zip(hge.revmap.itervalues(), 78 rebsrcindex = outgoing.index(rebasesrc)
78 hge.revmap.iterkeys())) 79 outgoing = outgoing[0:rebsrcindex] + [child.node(), ] + outgoing[rebsrcindex+1:]
79 outgoing = util.outgoing_revisions(ui, repo, hge, 80 hge = hg_delta_editor.HgChangeReceiver(hg_repo_path, ui_=ui)
80 svn_commit_hashes) 81 svn_commit_hashes = dict(zip(hge.revmap.itervalues(), hge.revmap.iterkeys()))
81 merc_util._encoding = oldencoding 82 merc_util._encoding = oldencoding
82 return 0 83 return 0
83 84
84 def _getdirchanges(svn, branchpath, parentctx, ctx, changedfiles): 85 def _getdirchanges(svn, branchpath, parentctx, ctx, changedfiles):
85 """Compute directories to add or delete when moving from parentctx 86 """Compute directories to add or delete when moving from parentctx