Patchwork D3104: simplestore: back up index when adding a revision

login
register
mail settings
Submitter phabricator
Date April 5, 2018, 1:25 a.m.
Message ID <differential-rev-PHID-DREV-mxbu65zq2hjqts5jpw3g-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/30328/
State Superseded
Headers show

Comments

phabricator - April 5, 2018, 1:25 a.m.
indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This ensures that transaction rollback reverts the index to its
  previous state. This fixed a few test failures due to `hg verify`
  complaining about a reference to an undefined changeset revision.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  tests/simplestorerepo.py
  tests/test-clone.t
  tests/test-subrepo-recursion.t

CHANGE DETAILS




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

Patch

diff --git a/tests/test-subrepo-recursion.t b/tests/test-subrepo-recursion.t
--- a/tests/test-subrepo-recursion.t
+++ b/tests/test-subrepo-recursion.t
@@ -466,6 +466,7 @@ 
   linking [          <=>                                 ] 10\r (no-eol) (esc) (reposimplestore !)
   linking [           <=>                                ] 11\r (no-eol) (esc) (reposimplestore !)
   linking [            <=>                               ] 12\r (no-eol) (esc) (reposimplestore !)
+  linking [             <=>                              ] 13\r (no-eol) (esc) (reposimplestore !)
                                                               \r (no-eol) (esc)
 #else
   $ hg clone -U . ../empty
@@ -497,6 +498,8 @@ 
   linking [            <=>                               ] 12\r (no-eol) (esc) (reposimplestore !)
   linking [             <=>                              ] 13\r (no-eol) (esc) (reposimplestore !)
   linking [              <=>                             ] 14\r (no-eol) (esc) (reposimplestore !)
+  linking [               <=>                            ] 15\r (no-eol) (esc) (reposimplestore !)
+  linking [                <=>                           ] 16\r (no-eol) (esc) (reposimplestore !)
                                                               \r (no-eol) (esc)
   \r (no-eol) (esc)
   archiving (foo) [                                     ] 0/3\r (no-eol) (esc)
@@ -513,6 +516,7 @@ 
   linking [      <=>                                      ] 6\r (no-eol) (esc)
   linking [       <=>                                     ] 7\r (no-eol) (esc) (reposimplestore !)
   linking [        <=>                                    ] 8\r (no-eol) (esc) (reposimplestore !)
+  linking [         <=>                                   ] 9\r (no-eol) (esc) (reposimplestore !)
                                                               \r (no-eol) (esc)
   \r (no-eol) (esc)
   archiving (foo/bar) [                                 ] 0/1\r (no-eol) (esc)
diff --git a/tests/test-clone.t b/tests/test-clone.t
--- a/tests/test-clone.t
+++ b/tests/test-clone.t
@@ -104,7 +104,8 @@ 
   linking: 15 (reposimplestore !)
   linking: 16 (reposimplestore !)
   linking: 17 (reposimplestore !)
-  linked 17 files (reposimplestore !)
+  linking: 18 (reposimplestore !)
+  linked 18 files (reposimplestore !)
 #else
   $ hg --debug clone -U . ../c --config progress.debug=true
   linking: 1
@@ -125,7 +126,8 @@ 
   copying: 15 (reposimplestore !)
   copying: 16 (reposimplestore !)
   copying: 17 (reposimplestore !)
-  copied 17 files (reposimplestore !)
+  copying: 18 (reposimplestore !)
+  copied 18 files (reposimplestore !)
 #endif
   $ cd ../c
 
diff --git a/tests/simplestorerepo.py b/tests/simplestorerepo.py
--- a/tests/simplestorerepo.py
+++ b/tests/simplestorerepo.py
@@ -405,6 +405,8 @@ 
         return 0, 0
 
     def add(self, text, meta, transaction, linkrev, p1, p2):
+        transaction.addbackup(self._indexpath)
+
         if meta or text.startswith(b'\1\n'):
             text = filelog.packmeta(meta, text)