Patchwork [2,of,4] rollback: have an empty entry for the vfsmap in rollback

login
register
mail settings
Submitter Pierre-Yves David
Date Jan. 17, 2015, 3:51 a.m.
Message ID <0487eefa5bd23b4236d0.1421466674@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/7511/
State Accepted
Commit bfa52f4ecf541fd76d057c6b849506223dd55648
Headers show

Comments

Pierre-Yves David - Jan. 17, 2015, 3:51 a.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@fb.com>
# Date 1421465356 28800
#      Fri Jan 16 19:29:16 2015 -0800
# Node ID 0487eefa5bd23b4236d0361a78accc1ac9af99f6
# Parent  fce27eb599b3f314fa1380a7ee2e1cf3db610f0f
rollback: have an empty entry for the vfsmap in rollback

This empty string key is used for the store. This will be needed to properly
rollback backup in a future changesets.

Patch

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -1005,11 +1005,11 @@  class localrepository(object):
         if dryrun:
             return 0
 
         parents = self.dirstate.parents()
         self.destroying()
-        vfsmap = {'plain': self.vfs}
+        vfsmap = {'plain': self.vfs, '': self.svfs}
         transaction.rollback(self.svfs, vfsmap, 'undo', ui.warn)
         if self.vfs.exists('undo.bookmarks'):
             self.vfs.rename('undo.bookmarks', 'bookmarks')
         if self.svfs.exists('undo.phaseroots'):
             self.svfs.rename('undo.phaseroots', 'phaseroots')