comparison mercurial/merge.py @ 44399:a45ffad9ae98

merge: introduce a merge() for that use-case In the same vein as some earlier patches like f546d2170b0f (merge: introduce a clean_update() for that use-case, 2020-01-15). Differential Revision: https://phab.mercurial-scm.org/D8168
author Martin von Zweigbergk <martinvonz@google.com>
date Wed, 26 Feb 2020 10:40:31 -0800
parents 5e3402a0b868
children 9d2b2df2c2ba
comparison
equal deleted inserted replaced
44398:ddbc296a1f48 44399:a45ffad9ae98
2588 b'update', parent1=xp1, parent2=xp2, error=stats.unresolvedcount 2588 b'update', parent1=xp1, parent2=xp2, error=stats.unresolvedcount
2589 ) 2589 )
2590 return stats 2590 return stats
2591 2591
2592 2592
2593 def merge(ctx, labels=None, force=False, wc=None):
2594 """Merge another topological branch into the working copy.
2595
2596 force = whether the merge was run with 'merge --force' (deprecated)
2597 """
2598
2599 return update(
2600 ctx.repo(),
2601 ctx.rev(),
2602 labels=labels,
2603 branchmerge=True,
2604 force=force,
2605 mergeforce=force,
2606 wc=wc,
2607 )
2608
2609
2593 def clean_update(ctx, wc=None): 2610 def clean_update(ctx, wc=None):
2594 """Do a clean update to the given commit. 2611 """Do a clean update to the given commit.
2595 2612
2596 This involves updating to the commit and discarding any changes in the 2613 This involves updating to the commit and discarding any changes in the
2597 working copy. 2614 working copy.