Mercurial > hg
comparison mercurial/merge.py @ 20279:5b4f963d21cc
merge: refactor initialization of variables in update
There is no code change here but this helps prepare for future commits that
will fix a bare update with obsolete markers.
author | Sean Farley <sean.michael.farley@gmail.com> |
---|---|
date | Wed, 06 Nov 2013 17:02:07 -0600 |
parents | 20ef533ffb01 |
children | 95b9c6149e17 |
comparison
equal
deleted
inserted
replaced
20278:20ef533ffb01 | 20279:5b4f963d21cc |
---|---|
677 | 677 |
678 onode = node | 678 onode = node |
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; |
685 # but currently we are only checking the branch tips. | 691 # but currently we are only checking the branch tips. |
686 try: | 692 try: |
689 if wc.branch() == "default": # no default branch! | 695 if wc.branch() == "default": # no default branch! |
690 node = repo.lookup("tip") # update to tip | 696 node = repo.lookup("tip") # update to tip |
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) |
702 | 706 |
703 ### check phase | 707 ### check phase |