##// END OF EJS Templates
merge: refactor initialization of variables in update...
Sean Farley -
r20279:5b4f963d default
parent child Browse files
Show More
@@ -679,6 +679,12 b' def update(repo, node, branchmerge, forc'
679 wlock = repo.wlock()
679 wlock = repo.wlock()
680 try:
680 try:
681 wc = repo[None]
681 wc = repo[None]
682 pl = wc.parents()
683 p1 = pl[0]
684 pa = None
685 if ancestor:
686 pa = repo[ancestor]
687
682 if node is None:
688 if node is None:
683 # Here is where we should consider bookmarks, divergent bookmarks,
689 # Here is where we should consider bookmarks, divergent bookmarks,
684 # foreground changesets (successors), and tip of current branch;
690 # foreground changesets (successors), and tip of current branch;
@@ -691,11 +697,9 b' def update(repo, node, branchmerge, forc'
691 else:
697 else:
692 raise util.Abort(_("branch %s not found") % wc.branch())
698 raise util.Abort(_("branch %s not found") % wc.branch())
693 overwrite = force and not branchmerge
699 overwrite = force and not branchmerge
694 pl = wc.parents()
700
695 p1, p2 = pl[0], repo[node]
701 p2 = repo[node]
696 if ancestor:
702 if pa is None:
697 pa = repo[ancestor]
698 else:
699 pa = p1.ancestor(p2)
703 pa = p1.ancestor(p2)
700
704
701 fp1, fp2, xp1, xp2 = p1.node(), p2.node(), str(p1), str(p2)
705 fp1, fp2, xp1, xp2 = p1.node(), p2.node(), str(p1), str(p2)
General Comments 0
You need to be logged in to leave comments. Login now