mercurial/destutil.py
branchstable
changeset 48796 c00d3ce4e94b
parent 48689 fbf7e383e961
child 48875 6000f5b25c9b
equal deleted inserted replaced
48776:b84ff512b645 48796:c00d3ce4e94b
    63         #     (i.e. 'tip')
    63         #     (i.e. 'tip')
    64         #
    64         #
    65         # replaced changesets: same as divergent except we know there
    65         # replaced changesets: same as divergent except we know there
    66         # is no conflict
    66         # is no conflict
    67         #
    67         #
    68         # pruned changeset: no update is done; though, we could
    68         # pruned changeset: update to the closest non-obsolete ancestor,
    69         #     consider updating to the first non-obsolete parent,
    69         # similar to what 'hg prune' currently does
    70         #     similar to what is current done for 'hg prune'
       
    71 
    70 
    72         if successors:
    71         if successors:
    73             # flatten the list here handles both divergent (len > 1)
    72             # flatten the list here handles both divergent (len > 1)
    74             # and the usual case (len = 1)
    73             # and the usual case (len = 1)
    75             successors = [n for sub in successors for n in sub]
    74             successors = [n for sub in successors for n in sub]
    76 
    75 
    77             # get the max revision for the given successors set,
    76             # get the max revision for the given successors set,
    78             # i.e. the 'tip' of a set
    77             # i.e. the 'tip' of a set
    79             node = repo.revs(b'max(%ln)', successors).first()
    78             node = repo.revs(b'max(%ln)', successors).first()
    80             if bookmarks.isactivewdirparent(repo):
    79         else:
    81                 movemark = repo[b'.'].node()
    80             p1 = p1.p1()
       
    81             while p1.obsolete():
       
    82                 p1 = p1.p1()
       
    83             node = p1.node()
       
    84 
       
    85         if node is not None and bookmarks.isactivewdirparent(repo):
       
    86             movemark = repo[b'.'].node()
       
    87 
    82     return node, movemark, None
    88     return node, movemark, None
    83 
    89 
    84 
    90 
    85 def _destupdatebook(repo, clean):
    91 def _destupdatebook(repo, clean):
    86     """decide on an update destination from active bookmark"""
    92     """decide on an update destination from active bookmark"""