mercurial/merge.py
changeset 30901 47278970fc8c
parent 30859 086c37652735
child 30902 e6932e9a262a
equal deleted inserted replaced
30900:23eed7d423b4 30901:47278970fc8c
  1554                     # Branching is a bit strange to ensure we do the minimal
  1554                     # Branching is a bit strange to ensure we do the minimal
  1555                     # amount of call to obsolete.background.
  1555                     # amount of call to obsolete.background.
  1556                     foreground = obsolete.foreground(repo, [p1.node()])
  1556                     foreground = obsolete.foreground(repo, [p1.node()])
  1557                     # note: the <node> variable contains a random identifier
  1557                     # note: the <node> variable contains a random identifier
  1558                     if repo[node].node() in foreground:
  1558                     if repo[node].node() in foreground:
  1559                         pas = [p1]  # allow updating to successors
  1559                         pass # allow updating to successors
  1560                     elif dirty:
  1560                     elif dirty:
  1561                         msg = _("uncommitted changes")
  1561                         msg = _("uncommitted changes")
  1562                         if onode is None:
  1562                         if onode is None:
  1563                             hint = _("commit and merge, or update --clean to"
  1563                             hint = _("commit and merge, or update --clean to"
  1564                                      " discard changes")
  1564                                      " discard changes")
  1570                         msg = _("not a linear update")
  1570                         msg = _("not a linear update")
  1571                         hint = _("merge or update --check to force update")
  1571                         hint = _("merge or update --check to force update")
  1572                         raise error.Abort(msg, hint=hint)
  1572                         raise error.Abort(msg, hint=hint)
  1573                 else:
  1573                 else:
  1574                     # Allow jumping branches if clean and specific rev given
  1574                     # Allow jumping branches if clean and specific rev given
  1575                     pas = [p1]
  1575                     pass
       
  1576 
       
  1577         if overwrite:
       
  1578             pas = [wc]
       
  1579         elif not branchmerge:
       
  1580             pas = [p1]
  1576 
  1581 
  1577         # deprecated config: merge.followcopies
  1582         # deprecated config: merge.followcopies
  1578         followcopies = repo.ui.configbool('merge', 'followcopies', True)
  1583         followcopies = repo.ui.configbool('merge', 'followcopies', True)
  1579         if overwrite:
  1584         if overwrite:
  1580             pas = [wc]
       
  1581             followcopies = False
  1585             followcopies = False
  1582         elif pas == [p2]: # backwards
       
  1583             pas = [p1]
       
  1584         elif not pas[0]:
  1586         elif not pas[0]:
  1585             followcopies = False
  1587             followcopies = False
  1586         if not branchmerge and not wc.dirty(missing=True):
  1588         if not branchmerge and not wc.dirty(missing=True):
  1587             followcopies = False
  1589             followcopies = False
  1588 
  1590