mercurial/repair.py
changeset 37084 f0b6fbea00cf
parent 37016 17692fefc8f2
child 38131 46c2b19a1263
equal deleted inserted replaced
37083:f99d64e8a4e4 37084:f0b6fbea00cf
    23     error,
    23     error,
    24     exchange,
    24     exchange,
    25     obsolete,
    25     obsolete,
    26     obsutil,
    26     obsutil,
    27     util,
    27     util,
       
    28 )
       
    29 from .utils import (
       
    30     stringutil,
    28 )
    31 )
    29 
    32 
    30 def backupbundle(repo, bases, heads, node, suffix, compress=True,
    33 def backupbundle(repo, bases, heads, node, suffix, compress=True,
    31                  obsolescence=True):
    34                  obsolescence=True):
    32     """create a bundle with the specified revisions as a backup"""
    35     """create a bundle with the specified revisions as a backup"""
   234             try:
   237             try:
   235                 undovfs.unlink(undofile)
   238                 undovfs.unlink(undofile)
   236             except OSError as e:
   239             except OSError as e:
   237                 if e.errno != errno.ENOENT:
   240                 if e.errno != errno.ENOENT:
   238                     ui.warn(_('error removing %s: %s\n') %
   241                     ui.warn(_('error removing %s: %s\n') %
   239                             (undovfs.join(undofile), util.forcebytestr(e)))
   242                             (undovfs.join(undofile),
       
   243                              stringutil.forcebytestr(e)))
   240 
   244 
   241     except: # re-raises
   245     except: # re-raises
   242         if backupfile:
   246         if backupfile:
   243             ui.warn(_("strip failed, backup bundle stored in '%s'\n")
   247             ui.warn(_("strip failed, backup bundle stored in '%s'\n")
   244                     % vfs.join(backupfile))
   248                     % vfs.join(backupfile))