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

login
register
mail settings
Submitter Pierre-Yves David
Date Oct. 3, 2016, 2:37 p.m.
Message ID <ec6cb977f8e62bf13f86.1475505437@nodosa.octopoid.net>
Download mbox | patch
Permalink /patch/16827/
State Accepted
Headers show

Comments

Pierre-Yves David - Oct. 3, 2016, 2:37 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@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.

Patch

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)