D6795: strip: fix bug with treemanifests and unordered linkrevs

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

D6795: strip: fix bug with treemanifests and unordered linkrevs

martinvonz (Martin von Zweigbergk)
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This is the treemanifest version of f45f7390c1c5 <https://phab.mercurial-scm.org/rHGf45f7390c1c599c4ed8c3e540da010d8140d3d77> (strip: calculate
  list of extra nodes to save and pass it to changegroupsubset,
  2008-01-19).

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/repair.py
  tests/test-strip-cross.t

CHANGE DETAILS

diff --git a/tests/test-strip-cross.t b/tests/test-strip-cross.t
--- a/tests/test-strip-cross.t
+++ b/tests/test-strip-cross.t
@@ -203,14 +203,9 @@
   checking changesets
   checking manifests
   checking directory manifests
-   dir/@0: parent-directory manifest refers to unknown revision 1c556153fe54
-   dir/@1: parent-directory manifest refers to unknown revision 1f76dba919fd
   crosschecking files in changesets and manifests
   checking files
-   dir/other@1: 5d9299349fc0 not in manifests
   checked 3 changesets with 4 changes to 3 files
-  3 integrity errors encountered!
-  (first damaged changeset appears to be 0)
   
   % Trying to strip revision 3
   saved backup bundle to $TESTTMP/treemanifests/3/.hg/strip-backup/e4e3de5c3cb2-f4c70376-backup.hg
diff --git a/mercurial/repair.py b/mercurial/repair.py
--- a/mercurial/repair.py
+++ b/mercurial/repair.py
@@ -81,14 +81,12 @@
     _, brokenset = revlog.getstrippoint(striprev)
     return [revlog.linkrev(r) for r in brokenset]
 
-def _collectmanifest(repo, striprev):
-    return _collectrevlog(repo.manifestlog.getstorage(b''), striprev)
-
 def _collectbrokencsets(repo, files, striprev):
     """return the changesets which will be broken by the truncation"""
     s = set()
 
-    s.update(_collectmanifest(repo, striprev))
+    for revlog in manifestrevlogs(repo):
+        s.update(_collectrevlog(revlog, striprev))
     for fname in files:
         s.update(_collectrevlog(repo.file(fname), striprev))
 



To: martinvonz, #hg-reviewers
Cc: mercurial-devel
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|

D6795: strip: fix bug with treemanifests and unordered linkrevs

martinvonz (Martin von Zweigbergk)
Closed by commit rHGa8b249b2f8cc: strip: fix bug with treemanifests and unordered linkrevs (authored by martinvonz).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6795?vs=16400&id=16464

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6795/new/

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

AFFECTED FILES
  mercurial/repair.py
  tests/test-strip-cross.t

CHANGE DETAILS

diff --git a/tests/test-strip-cross.t b/tests/test-strip-cross.t
--- a/tests/test-strip-cross.t
+++ b/tests/test-strip-cross.t
@@ -203,14 +203,9 @@
   checking changesets
   checking manifests
   checking directory manifests
-   dir/@0: parent-directory manifest refers to unknown revision 1c556153fe54
-   dir/@1: parent-directory manifest refers to unknown revision 1f76dba919fd
   crosschecking files in changesets and manifests
   checking files
-   dir/other@1: 5d9299349fc0 not in manifests
   checked 3 changesets with 4 changes to 3 files
-  3 integrity errors encountered!
-  (first damaged changeset appears to be 0)
   
   % Trying to strip revision 3
   saved backup bundle to $TESTTMP/treemanifests/3/.hg/strip-backup/e4e3de5c3cb2-f4c70376-backup.hg
diff --git a/mercurial/repair.py b/mercurial/repair.py
--- a/mercurial/repair.py
+++ b/mercurial/repair.py
@@ -81,14 +81,12 @@
     _, brokenset = revlog.getstrippoint(striprev)
     return [revlog.linkrev(r) for r in brokenset]
 
-def _collectmanifest(repo, striprev):
-    return _collectrevlog(repo.manifestlog.getstorage(b''), striprev)
-
 def _collectbrokencsets(repo, files, striprev):
     """return the changesets which will be broken by the truncation"""
     s = set()
 
-    s.update(_collectmanifest(repo, striprev))
+    for revlog in manifestrevlogs(repo):
+        s.update(_collectrevlog(revlog, striprev))
     for fname in files:
         s.update(_collectrevlog(repo.file(fname), striprev))
 



To: martinvonz, #hg-reviewers, pulkit
Cc: mercurial-devel
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel