Patchwork [1,of,3,V2] histedit: add inprogress method to state class

login
register
mail settings
Submitter Christian Delahousse
Date Oct. 9, 2015, 6:11 p.m.
Message ID <95c5584b9a2f7aa755eb.1444414292@dev4253.prn1.facebook.com>
Download mbox | patch
Permalink /patch/10917/
State Accepted
Headers show

Comments

Christian Delahousse - Oct. 9, 2015, 6:11 p.m.
# HG changeset patch
# User Christian Delahousse <cdelahousse@fb.com>
# Date 1444088057 25200
#      Mon Oct 05 16:34:17 2015 -0700
# Node ID 95c5584b9a2f7aa755ebb196d1c2edbb04d281ae
# Parent  6e715040c1725b5debce888c4f7d3fdbf55cc900
histedit: add inprogress method to state class

If a histedit is progress, the 'histedit-state' file should exist. The patch
implements a convenience function to do check if a histedit is in progress.

This method will be use in next patch in the series.

Patch

diff --git a/hgext/histedit.py b/hgext/histedit.py
--- a/hgext/histedit.py
+++ b/hgext/histedit.py
@@ -312,6 +312,9 @@ 
     def clear(self):
         self.repo.vfs.unlink('histedit-state')
 
+    def inprogress(self):
+        return self.repo.vfs.exists('histedit-state')
+
 class histeditaction(object):
     def __init__(self, state, node):
         self.state = state