comparison mercurial/scmutil.py @ 35009:99ab7bc944d2 stable

scmutil: don't try to delete origbackup symlinks to directories (issue5731) When origbackuppath is set, when looking to see if a file we are backing up conflicts with a directory in the origbackuppath, we incorrectly match on symlinks to directories. This means we try to call vfs.rmtree on the symlink, which fails. Differential Revision: https://phab.mercurial-scm.org/D1311
author Mark Thomas <mbthomas@fb.com>
date Fri, 03 Nov 2017 09:27:36 -0700
parents 39b094e4ae2c
children 96dcc78468e3
comparison
equal deleted inserted replaced
35008:ad671b4cb9fc 35009:99ab7bc944d2
608 origvfs.unlink(f) 608 origvfs.unlink(f)
609 break 609 break
610 610
611 origvfs.makedirs(origbackupdir) 611 origvfs.makedirs(origbackupdir)
612 612
613 if origvfs.isdir(filepathfromroot): 613 if origvfs.isdir(filepathfromroot) and not origvfs.islink(filepathfromroot):
614 ui.note(_('removing conflicting directory: %s\n') 614 ui.note(_('removing conflicting directory: %s\n')
615 % origvfs.join(filepathfromroot)) 615 % origvfs.join(filepathfromroot))
616 origvfs.rmtree(filepathfromroot, forcibly=True) 616 origvfs.rmtree(filepathfromroot, forcibly=True)
617 617
618 return origvfs.join(filepathfromroot) 618 return origvfs.join(filepathfromroot)