D6380: copies: fix duplicatecopies() with overlay context

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Thu May 16 07:59:18 EDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rHGac1dc92dc516: copies: fix duplicatecopies() with overlay context (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6380?vs=15124&id=15140

REVISION DETAIL
  https://phab.mercurial-scm.org/D6380

AFFECTED FILES
  mercurial/context.py
  mercurial/copies.py
  tests/test-rebase-inmemory.t

CHANGE DETAILS

diff --git a/tests/test-rebase-inmemory.t b/tests/test-rebase-inmemory.t
--- a/tests/test-rebase-inmemory.t
+++ b/tests/test-rebase-inmemory.t
@@ -795,12 +795,10 @@
   $ hg co -q 0
   $ echo a2 > a
   $ hg ci -qm 'modify a'
-BROKEN: obviously...
   $ hg rebase -r . -d 1 --collapse
   rebasing 2:41c4ea50d4cf "modify a" (tip)
   merging b and a to b
-  abort: a at b977edf6f839: not found in manifest!
-  [255]
+  saved backup bundle to $TESTTMP/rebase-rename-collapse/.hg/strip-backup/41c4ea50d4cf-b90b7994-rebase.hg
   $ cd ..
 
 Test rebasing when the file we are merging in destination is empty
diff --git a/mercurial/copies.py b/mercurial/copies.py
--- a/mercurial/copies.py
+++ b/mercurial/copies.py
@@ -798,4 +798,5 @@
     for dst, src in pathcopies(repo[fromrev], repo[rev]).iteritems():
         if dst in exclude:
             continue
-        wctx[dst].markcopied(src)
+        if dst in wctx:
+            wctx[dst].markcopied(src)
diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -1773,8 +1773,7 @@
 
     def markcopied(self, src):
         """marks this file a copy of `src`"""
-        if self._repo.dirstate[self._path] in "nma":
-            self._repo.dirstate.copy(src, self._path)
+        self._repo.dirstate.copy(src, self._path)
 
     def clearunknown(self):
         """Removes conflicting items in the working directory so that



To: martinvonz, #hg-reviewers, pulkit
Cc: mercurial-devel


More information about the Mercurial-devel mailing list