Mercurial > hg
comparison mercurial/narrowspec.py @ 38871:204e074c188e
narrow: drop checkambig=True when restoring backup
IIUC, checkambig is about updating timestamps of the file while
renaming. That's important for the dirstate, but we never check the
timestamp of the narrowspec file. We can therefore avoid checking
passing checkambig=True.
Differential Revision: https://phab.mercurial-scm.org/D4098
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Fri, 03 Aug 2018 13:53:02 -0700 |
parents | ae2962bb56a3 |
children | 576eef1ab43d |
comparison
equal
deleted
inserted
replaced
38870:ae2962bb56a3 | 38871:204e074c188e |
---|---|
135 util.copyfile(vfs.join(FILENAME), vfs.join(backupname), hardlink=True) | 135 util.copyfile(vfs.join(FILENAME), vfs.join(backupname), hardlink=True) |
136 | 136 |
137 def restorebackup(repo, backupname): | 137 def restorebackup(repo, backupname): |
138 if repository.NARROW_REQUIREMENT not in repo.requirements: | 138 if repository.NARROW_REQUIREMENT not in repo.requirements: |
139 return | 139 return |
140 repo.vfs.rename(backupname, FILENAME, checkambig=True) | 140 repo.vfs.rename(backupname, FILENAME) |
141 | 141 |
142 def clearbackup(repo, backupname): | 142 def clearbackup(repo, backupname): |
143 if repository.NARROW_REQUIREMENT not in repo.requirements: | 143 if repository.NARROW_REQUIREMENT not in repo.requirements: |
144 return | 144 return |
145 repo.vfs.unlink(backupname) | 145 repo.vfs.unlink(backupname) |