Patchwork D5470: narrow: keep narrowspec backup in store

login
register
mail settings
Submitter phabricator
Date Dec. 23, 2018, 2:14 a.m.
Message ID <47fd30f64eb00d61bddb84ebe5b187ff@localhost.localdomain>
Download mbox | patch
Permalink /patch/37324/
State Not Applicable
Headers show

Comments

phabricator - Dec. 23, 2018, 2:14 a.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG1e8d9f472ea1: narrow: keep narrowspec backup in store (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5470?vs=12934&id=12958

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

AFFECTED FILES
  mercurial/narrowspec.py
  tests/test-narrow-clone-stream.t

CHANGE DETAILS




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

Patch

diff --git a/tests/test-narrow-clone-stream.t b/tests/test-narrow-clone-stream.t
--- a/tests/test-narrow-clone-stream.t
+++ b/tests/test-narrow-clone-stream.t
@@ -77,6 +77,7 @@ 
   00manifest.i
   data (tree flat-fncache !)
   fncache (tree flat-fncache !)
+  journal.narrowspec
   meta (tree !)
   narrowspec
   undo
diff --git a/mercurial/narrowspec.py b/mercurial/narrowspec.py
--- a/mercurial/narrowspec.py
+++ b/mercurial/narrowspec.py
@@ -160,19 +160,19 @@ 
 def savebackup(repo, backupname):
     if repository.NARROW_REQUIREMENT not in repo.requirements:
         return
-    vfs = repo.vfs
-    vfs.tryunlink(backupname)
-    util.copyfile(repo.svfs.join(FILENAME), vfs.join(backupname), hardlink=True)
+    svfs = repo.svfs
+    svfs.tryunlink(backupname)
+    util.copyfile(svfs.join(FILENAME), svfs.join(backupname), hardlink=True)
 
 def restorebackup(repo, backupname):
     if repository.NARROW_REQUIREMENT not in repo.requirements:
         return
-    util.rename(repo.vfs.join(backupname), repo.svfs.join(FILENAME))
+    util.rename(repo.svfs.join(backupname), repo.svfs.join(FILENAME))
 
 def clearbackup(repo, backupname):
     if repository.NARROW_REQUIREMENT not in repo.requirements:
         return
-    repo.vfs.unlink(backupname)
+    repo.svfs.unlink(backupname)
 
 def restrictpatterns(req_includes, req_excludes, repo_includes, repo_excludes):
     r""" Restricts the patterns according to repo settings,