mercurial/transaction.py
changeset 23315 66275ecc73c1
parent 23314 43f66ae57a66
child 23316 fc3670f41d3e
equal deleted inserted replaced
23314:43f66ae57a66 23315:66275ecc73c1
    10 #
    10 #
    11 # This software may be used and distributed according to the terms of the
    11 # This software may be used and distributed according to the terms of the
    12 # GNU General Public License version 2 or any later version.
    12 # GNU General Public License version 2 or any later version.
    13 
    13 
    14 from i18n import _
    14 from i18n import _
       
    15 import os
    15 import errno
    16 import errno
    16 import error, util
    17 import error, util
    17 
    18 
    18 version = 2
    19 version = 2
    19 
    20 
   201             msg = 'cannot use transaction.addbackup inside "group"'
   202             msg = 'cannot use transaction.addbackup inside "group"'
   202             raise RuntimeError(msg)
   203             raise RuntimeError(msg)
   203 
   204 
   204         if file in self.map or file in self._backupmap:
   205         if file in self.map or file in self._backupmap:
   205             return
   206             return
   206         backupfile = "%s.backup.%s" % (self.journal, file)
   207         dirname, filename = os.path.split(file)
       
   208 
       
   209         backupfilename = "%s.backup.%s" % (self.journal, filename)
       
   210         backupfile = os.path.join(dirname, backupfilename)
   207         if vfs is None:
   211         if vfs is None:
   208             vfs = self.opener
   212             vfs = self.opener
   209         if vfs.exists(file):
   213         if vfs.exists(file):
   210             filepath = vfs.join(file)
   214             filepath = vfs.join(file)
   211             backuppath = vfs.join(backupfile)
   215             backuppath = vfs.join(backupfile)