##// END OF EJS Templates
merge: remove unused handling of default destination in merge.update()...
Martin von Zweigbergk -
r30902:e6932e9a default
parent child Browse files
Show More
@@ -1448,7 +1448,7 b' def update(repo, node, branchmerge, forc'
1448 """
1448 """
1449 Perform a merge between the working directory and the given node
1449 Perform a merge between the working directory and the given node
1450
1450
1451 node = the node to update to, or None if unspecified
1451 node = the node to update to
1452 branchmerge = whether to merge between branches
1452 branchmerge = whether to merge between branches
1453 force = whether to force branch merging or file overwriting
1453 force = whether to force branch merging or file overwriting
1454 matcher = a matcher to filter file lists (dirstate not updated)
1454 matcher = a matcher to filter file lists (dirstate not updated)
@@ -1491,7 +1491,9 b' def update(repo, node, branchmerge, forc'
1491 Return the same tuple as applyupdates().
1491 Return the same tuple as applyupdates().
1492 """
1492 """
1493
1493
1494 onode = node
1494 # This functon used to find the default destination if node was None, but
1495 # that's now in destutil.py.
1496 assert node is not None
1495 # If we're doing a partial update, we need to skip updating
1497 # If we're doing a partial update, we need to skip updating
1496 # the dirstate, so make a note of any partial-ness to the
1498 # the dirstate, so make a note of any partial-ness to the
1497 # update here.
1499 # update here.
@@ -1550,25 +1552,16 b' def update(repo, node, branchmerge, forc'
1550
1552
1551 if pas not in ([p1], [p2]): # nonlinear
1553 if pas not in ([p1], [p2]): # nonlinear
1552 dirty = wc.dirty(missing=True)
1554 dirty = wc.dirty(missing=True)
1553 if dirty or onode is None:
1555 if dirty:
1554 # Branching is a bit strange to ensure we do the minimal
1556 # Branching is a bit strange to ensure we do the minimal
1555 # amount of call to obsolete.background.
1557 # amount of call to obsolete.background.
1556 foreground = obsolete.foreground(repo, [p1.node()])
1558 foreground = obsolete.foreground(repo, [p1.node()])
1557 # note: the <node> variable contains a random identifier
1559 # note: the <node> variable contains a random identifier
1558 if repo[node].node() in foreground:
1560 if repo[node].node() in foreground:
1559 pass # allow updating to successors
1561 pass # allow updating to successors
1560 elif dirty:
1562 else:
1561 msg = _("uncommitted changes")
1563 msg = _("uncommitted changes")
1562 if onode is None:
1564 hint = _("commit or update --clean to discard changes")
1563 hint = _("commit and merge, or update --clean to"
1564 " discard changes")
1565 else:
1566 hint = _("commit or update --clean to discard"
1567 " changes")
1568 raise error.Abort(msg, hint=hint)
1569 else: # node is none
1570 msg = _("not a linear update")
1571 hint = _("merge or update --check to force update")
1572 raise error.Abort(msg, hint=hint)
1565 raise error.Abort(msg, hint=hint)
1573 else:
1566 else:
1574 # Allow jumping branches if clean and specific rev given
1567 # Allow jumping branches if clean and specific rev given
General Comments 0
You need to be logged in to leave comments. Login now