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

login
register
mail settings
Submitter Pierre-Yves David
Date Nov. 14, 2014, 6:58 p.m.
Message ID <ff306c25475d36509de0.1415991501@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/6734/
State Accepted
Commit 43f66ae57a66499e14bd0949d262ab9b5664f7f9
Headers show

Comments

Pierre-Yves David - Nov. 14, 2014, 6:58 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@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.)

Patch

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))