Mercurial > public > mercurial-scm > hg
comparison mercurial/merge.py @ 27429:2e31a17ad1bf
manifestmerge: have manifest do matching before diffing
This means that the diff code does less work, potentially
significantly less in the case of treemanifests. It also should ease
implementation with narrowed clone cases (such as narrowhg) when we
don't always have the entire set of treemanifest revlogs locally.
As far as I can tell, this codepath is currently only used by record,
so it'll probably die in the near future, and then narrowhg won't have
to worry about composing with some unknown matching system.
author | Augie Fackler <augie@google.com> |
---|---|
date | Mon, 14 Dec 2015 20:57:21 -0500 |
parents | ba0da4b7397d |
children | b8405d739149 |
comparison
equal
deleted
inserted
replaced
27428:71d0fd3c2e24 | 27429:2e31a17ad1bf |
---|---|
720 if wctx.sub(s).dirty(): | 720 if wctx.sub(s).dirty(): |
721 m1['.hgsubstate'] += '+' | 721 m1['.hgsubstate'] += '+' |
722 break | 722 break |
723 | 723 |
724 # Compare manifests | 724 # Compare manifests |
725 if matcher is not None: | |
726 m1 = m1.matches(matcher) | |
727 m2 = m2.matches(matcher) | |
725 diff = m1.diff(m2) | 728 diff = m1.diff(m2) |
726 | 729 |
727 actions = {} | 730 actions = {} |
728 for f, ((n1, fl1), (n2, fl2)) in diff.iteritems(): | 731 for f, ((n1, fl1), (n2, fl2)) in diff.iteritems(): |
729 if matcher and not matcher(f): | |
730 continue | |
731 if n1 and n2: # file exists on both local and remote side | 732 if n1 and n2: # file exists on both local and remote side |
732 if f not in ma: | 733 if f not in ma: |
733 fa = copy.get(f, None) | 734 fa = copy.get(f, None) |
734 if fa is not None: | 735 if fa is not None: |
735 actions[f] = ('m', (f, f, fa, False, pa.node()), | 736 actions[f] = ('m', (f, f, fa, False, pa.node()), |