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

login
register
mail settings
Submitter Christian Delahousse
Date Oct. 8, 2015, 10 p.m.
Message ID <a4ca3731ba2ccb54d2a5.1444341604@dev4253.prn1.facebook.com>
Download mbox | patch
Permalink /patch/10898/
State Superseded
Commit 42b9086738660ac635e80f9cc2268744cddba9aa
Headers show

Comments

Christian Delahousse - Oct. 8, 2015, 10 p.m.
# HG changeset patch
# User Christian Delahousse <cdelahousse@fb.com>
# Date 1444088057 25200
#      Mon Oct 05 16:34:17 2015 -0700
# Node ID a4ca3731ba2ccb54d2a549876fa74f55a84216bb
# Parent  875e5d89dc86a616ac43c12519ded0d1d75e13f5
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