diff hgext/rebase.py @ 18386:03442135dff4

refactoring: use unlinkpath with ignoremissing
author Mads Kiilerich <madski@unity3d.com>
date Tue, 15 Jan 2013 23:30:10 +0100
parents 9454e40e047b
children 100fdc84670f
line wrap: on
line diff
--- a/hgext/rebase.py	Tue Jan 15 23:30:10 2013 +0100
+++ b/hgext/rebase.py	Tue Jan 15 23:30:10 2013 +0100
@@ -319,8 +319,7 @@
 
         clearstatus(repo)
         ui.note(_("rebase completed\n"))
-        if os.path.exists(repo.sjoin('undo')):
-            util.unlinkpath(repo.sjoin('undo'))
+        util.unlinkpath(repo.sjoin('undo'), ignoremissing=True)
         if skipped:
             ui.note(_("%d revisions have been skipped\n") % len(skipped))
 
@@ -508,8 +507,7 @@
 
 def clearstatus(repo):
     'Remove the status files'
-    if os.path.exists(repo.join("rebasestate")):
-        util.unlinkpath(repo.join("rebasestate"))
+    util.unlinkpath(repo.join("rebasestate"), ignoremissing=True)
 
 def restorestatus(repo):
     'Restore a previously stored status'