Mercurial > hg
changeset 16094:0776a6cababe
merge: don't use unknown()
This removes use of unknown files for building the synthetic working
directory manifest used by manifestmerge. Instead, we adopt the
strategy used by _checkunknown.
Side-effect: unknown files are no longer moved by remote directory
renames, and now are left alone like ignored files.
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Thu, 09 Feb 2012 17:04:17 -0600 |
parents | 7e30f5f2285f |
children | 3eab42088be4 |
files | hgext/largefiles/overrides.py mercurial/context.py mercurial/merge.py tests/test-graft.t tests/test-issue612.t tests/test-rename-dir-merge.t |
diffstat | 6 files changed, 22 insertions(+), 32 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/largefiles/overrides.py Thu Feb 09 16:50:19 2012 -0600 +++ b/hgext/largefiles/overrides.py Thu Feb 09 17:04:17 2012 -0600 @@ -319,7 +319,7 @@ processed.append((standin, "g", p2.flags(standin))) else: processed.append((standin, "r")) - elif m == "m" and lfutil.standin(f) in p1 and f in p2: + elif m == "g" and lfutil.standin(f) in p1 and f in p2: # Case 2: largefile in the working copy, normal file in # the second parent standin = lfutil.standin(f)
--- a/mercurial/context.py Thu Feb 09 16:50:19 2012 -0600 +++ b/mercurial/context.py Thu Feb 09 17:04:17 2012 -0600 @@ -698,9 +698,6 @@ def _manifest(self): """generate a manifest corresponding to the working directory""" - if self._unknown is None: - self.status(unknown=True) - man = self._parents[0].manifest().copy() if len(self._parents) > 1: man2 = self.p2().manifest() @@ -714,8 +711,7 @@ copied = self._repo.dirstate.copies() ff = self._flagfunc modified, added, removed, deleted = self._status - unknown = self._unknown - for i, l in (("a", added), ("m", modified), ("u", unknown)): + for i, l in (("a", added), ("m", modified)): for f in l: orig = copied.get(f, f) man[f] = getman(orig).get(orig, nullid) + i
--- a/mercurial/merge.py Thu Feb 09 16:50:19 2012 -0600 +++ b/mercurial/merge.py Thu Feb 09 17:04:17 2012 -0600 @@ -245,7 +245,7 @@ act("prompt keep", "a", f) elif n[20:] == "a": # added, no remote act("remote deleted", "f", f) - elif n[20:] != "u": + else: act("other deleted", "r", f) for f, n in m2.iteritems(): @@ -265,7 +265,13 @@ act("remote moved to " + f, "m", f2, f, f, fmerge(f2, f, f2), True) elif f not in ma: - act("remote created", "g", f, m2.flags(f)) + if (not overwrite + and _checkunknownfile(repo, p1, p2, f)): + rflags = fmerge(f, f, f) + act("remote differs from untracked local", + "m", f, f, f, rflags, False) + else: + act("remote created", "g", f, m2.flags(f)) elif n != ma[f]: if repo.ui.promptchoice( _("remote changed %s which local deleted\n" @@ -559,7 +565,6 @@ ### calculate phase action = [] - wc.status(unknown=True) # prime cache folding = not util.checkcase(repo.path) if not force: _checkunknown(repo, wc, p2)
--- a/tests/test-graft.t Thu Feb 09 16:50:19 2012 -0600 +++ b/tests/test-graft.t Thu Feb 09 17:04:17 2012 -0600 @@ -114,7 +114,6 @@ grafting revision 1 searching for copies back to rev 1 unmatched files in local: - a.orig b all copies found (* = to merge, ! = divergent): b -> a * @@ -130,8 +129,6 @@ b: copy a:b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 grafting revision 5 searching for copies back to rev 1 - unmatched files in local: - a.orig resolving manifests overwrite: False, partial: False ancestor: 4c60f11aa304, local: 6f5ea6ac8b70+, remote: 97f8bfe72746 @@ -141,8 +138,6 @@ e grafting revision 4 searching for copies back to rev 1 - unmatched files in local: - a.orig resolving manifests overwrite: False, partial: False ancestor: 4c60f11aa304, local: 77eb504366ab+, remote: 9c233e8e184d
--- a/tests/test-issue612.t Thu Feb 09 16:50:19 2012 -0600 +++ b/tests/test-issue612.t Thu Feb 09 17:04:17 2012 -0600 @@ -24,11 +24,11 @@ $ hg merge merging src/a.c and source/a.c to source/a.c - 1 files updated, 1 files merged, 0 files removed, 0 files unresolved + 0 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg status M source/a.c R src/a.c - ? source/a.o + ? src/a.o
--- a/tests/test-rename-dir-merge.t Thu Feb 09 16:50:19 2012 -0600 +++ b/tests/test-rename-dir-merge.t Thu Feb 09 17:04:17 2012 -0600 @@ -27,7 +27,6 @@ searching for copies back to rev 1 unmatched files in local: a/c - a/d unmatched files in other: b/a b/b @@ -37,33 +36,29 @@ checking for directory renames dir a/ -> b/ file a/c -> b/c - file a/d -> b/d resolving manifests overwrite: False, partial: False ancestor: f9b20c0d4c51, local: ce36d17b18fb+, remote: 397f8b00a740 - a/d: remote renamed directory to b/d -> d a/c: remote renamed directory to b/c -> d a/b: other deleted -> r a/a: other deleted -> r b/a: remote created -> g b/b: remote created -> g - updating: a/a 1/6 files (16.67%) + updating: a/a 1/5 files (20.00%) removing a/a - updating: a/b 2/6 files (33.33%) + updating: a/b 2/5 files (40.00%) removing a/b - updating: a/c 3/6 files (50.00%) + updating: a/c 3/5 files (60.00%) moving a/c to b/c - updating: a/d 4/6 files (66.67%) - moving a/d to b/d - updating: b/a 5/6 files (83.33%) + updating: b/a 4/5 files (80.00%) getting b/a - updating: b/b 6/6 files (100.00%) + updating: b/b 5/5 files (100.00%) getting b/b - 4 files updated, 0 files merged, 2 files removed, 0 files unresolved + 3 files updated, 0 files merged, 2 files removed, 0 files unresolved (branch merge, don't forget to commit) $ echo a/* b/* - a/* b/a b/b b/c b/d + a/d b/a b/b b/c $ hg st -C M b/a M b/b @@ -72,7 +67,7 @@ R a/a R a/b R a/c - ? b/d + ? a/d $ hg ci -m "3 merge 2+1" $ hg debugrename b/c b/c renamed from a/c:354ae8da6e890359ef49ade27b68bbc361f3ca88 (glob) @@ -84,7 +79,6 @@ unmatched files in local: b/a b/b - b/d unmatched files in other: a/c all copies found (* = to merge, ! = divergent): @@ -103,11 +97,11 @@ (branch merge, don't forget to commit) $ echo a/* b/* - a/* b/a b/b b/c b/d + a/d b/a b/b b/c $ hg st -C A b/c a/c - ? b/d + ? a/d $ hg ci -m "4 merge 1+2" created new head $ hg debugrename b/c