Patchwork D6358: overlaycontext: allow calling copydata() on clean context

login
register
mail settings
Submitter phabricator
Date May 15, 2019, 6:02 p.m.
Message ID <926af4c91ed86b2c23bc21aec7825df5@localhost.localdomain>
Download mbox | patch
Permalink /patch/40048/
State Not Applicable
Headers show

Comments

phabricator - May 15, 2019, 6:02 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGcdcebc897529: overlaycontext: allow calling copydata() on clean context (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6358?vs=15051&id=15100

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

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

CHANGE DETAILS




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

Patch

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
@@ -774,8 +774,14 @@ 
   $ hg co -q 0
   $ hg mv a b
   $ hg ci -qm 'rename a to b'
-  $ hg rebase -d 1 2>&1 | grep '** ProgrammingError'
-  ** ProgrammingError: copydata() called on clean context
+  $ hg rebase -d 1
+  rebasing 2:b977edf6f839 "rename a to b" (tip)
+  merging a and b to b
+  saved backup bundle to $TESTTMP/rebase-rename/.hg/strip-backup/b977edf6f839-0864f570-rebase.hg
+  $ hg st --copies --change .
+  A b
+    a
+  R a
   $ cd ..
 
 Test rebasing when the file we are merging in destination is empty
diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -1913,7 +1913,7 @@ 
         if self.isdirty(path):
             return self._cache[path]['copied']
         else:
-            raise error.ProgrammingError('copydata() called on clean context')
+            return None
 
     def flags(self, path):
         if self.isdirty(path):