# HG changeset patch # User Christian Delahousse # Date 1444169368 25200 # Node ID 49b568a4e539b135f02a3ffd8965dc2779ec5fea # Parent 42b9086738660ac635e80f9cc2268744cddba9aa histedit: check presence of statefile before deleting it When the histeditstate class instance has it's clear() method called, there is nothing to check to see if the state file exists before deleting it. It may not exist, which would create an exception. This patch allows clear to be called at any time. This will be needed for the following patch. diff -r 42b908673866 -r 49b568a4e539 hgext/histedit.py --- a/hgext/histedit.py Mon Oct 05 16:34:17 2015 -0700 +++ b/hgext/histedit.py Tue Oct 06 15:09:28 2015 -0700 @@ -310,7 +310,8 @@ return parentctxnode, rules, keep, topmost, replacements, backupfile def clear(self): - self.repo.vfs.unlink('histedit-state') + if self.inprogress(): + self.repo.vfs.unlink('histedit-state') def inprogress(self): return self.repo.vfs.exists('histedit-state')