changeset 20975:37cdf1fca1b2

localrepo: make "undofiles()" return list of tuples "(vfs, relative filename)" Before this patch, "localrepository.undofiles()" returns list of absolute filename of undo files. This patch makes it return list of tuples "(vfs, relative filename)" to access undo files via vfs. This patch also changes "repair.strip()", which is the only user of "localrepository.undofiles()".
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Sun, 09 Mar 2014 01:03:28 +0900
parents ef377f2e0ab9
children c20f4898631e
files mercurial/localrepo.py mercurial/repair.py
diffstat 2 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/localrepo.py	Fri Apr 11 17:20:15 2014 -0400
+++ b/mercurial/localrepo.py	Sun Mar 09 01:03:28 2014 +0900
@@ -862,7 +862,7 @@
                 (self.svfs, 'journal.phaseroots'))
 
     def undofiles(self):
-        return [vfs.join(undoname(x)) for vfs, x in self._journalfiles()]
+        return [(vfs, undoname(x)) for vfs, x in self._journalfiles()]
 
     def _writejournal(self, desc):
         self.opener.write("journal.dirstate",
--- a/mercurial/repair.py	Fri Apr 11 17:20:15 2014 -0400
+++ b/mercurial/repair.py	Sun Mar 09 01:03:28 2014 +0900
@@ -157,12 +157,13 @@
                 os.unlink(chgrpfile)
 
         # remove undo files
-        for undofile in repo.undofiles():
+        for undovfs, undofile in repo.undofiles():
             try:
-                os.unlink(undofile)
+                undovfs.unlink(undofile)
             except OSError, e:
                 if e.errno != errno.ENOENT:
-                    ui.warn(_('error removing %s: %s\n') % (undofile, str(e)))
+                    ui.warn(_('error removing %s: %s\n') %
+                            (undovfs.join(undofile), str(e)))
 
         for m in updatebm:
             bm[m] = repo[newbmtarget].node()