[PATCH 1 of 4] bisect: access the filesystem through vfs when reseting

Pierre-Yves David pierre-yves.david at ens-lyon.org
Mon Oct 3 14:37:17 UTC 2016


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at ens-lyon.org>
# Date 1472005909 -7200
#      Wed Aug 24 04:31:49 2016 +0200
# Node ID ec6cb977f8e62bf13f86c3a7ebbee182ae50422e
# Parent  ff7697b436aba70b752a6277eaf4e9ef298e3640
# EXP-Topic bisect
bisect: access the filesystem through vfs when reseting

We have nice and shiny abstractions now.

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -902,9 +902,8 @@ def bisect(ui, repo, rev=None, extra=Non
     cmdutil.checkunfinished(repo)
 
     if reset:
-        p = repo.join("bisect.state")
-        if os.path.exists(p):
-            os.unlink(p)
+        if repo.vfs.exists("bisect.state"):
+            repo.vfs.unlink("bisect.state")
         return
 
     state = hbisect.load_state(repo)


More information about the Mercurial-devel mailing list