[PATCH 1 of 5 main-line-of-work (12 more to go)] addbackup: use the vfs for the backup destination too

Pierre-Yves David pierre-yves.david at ens-lyon.org
Fri Nov 14 12:58:21 CST 2014


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at fb.com>
# Date 1415976895 0
#      Fri Nov 14 14:54:55 2014 +0000
# Node ID ff306c25475d36509de0d0ab8802a9b7d5967d87
# Parent  8cec32819854344d57f0a39c786494ce0bfc2b5a
addbackup: use the vfs for the backup destination too

The backup file location was always computed using the opener, bypassing the
'location' setting. (And making the feature broken.)

diff --git a/mercurial/transaction.py b/mercurial/transaction.py
--- a/mercurial/transaction.py
+++ b/mercurial/transaction.py
@@ -206,11 +206,11 @@ class transaction(object):
         backupfile = "%s.backup.%s" % (self.journal, file)
         if vfs is None:
             vfs = self.opener
         if vfs.exists(file):
             filepath = vfs.join(file)
-            backuppath = self.opener.join(backupfile)
+            backuppath = vfs.join(backupfile)
             util.copyfiles(filepath, backuppath, hardlink=hardlink)
         else:
             backupfile = ''
 
         self._addbackupentry(('', file, backupfile, False))


More information about the Mercurial-devel mailing list