Patchwork [2,of,4,evolve-ext-V3] evolve: add new method _evolvestateread

login
register
mail settings
Submitter Shusen LIU
Date Dec. 18, 2015, 1 p.m.
Message ID <849220773eb179b2ffd6.1450443647@dev1221.lla1.facebook.com>
Download mbox | patch
Permalink /patch/12147/
State Superseded
Delegated to: Pierre-Yves David
Headers show

Comments

Shusen LIU - Dec. 18, 2015, 1 p.m.
# HG changeset patch
# User Shusen LIU <liushusen@fb.com>
# Date 1450308002 28800
#      Wed Dec 16 15:20:02 2015 -0800
# Node ID 849220773eb179b2ffd6eb6e04f0267f6815311d
# Parent  8e8491c49ddeca5f70de118b03ec74003d17c7ce
evolve: add new method _evolvestateread

This patch introduces a new method _evolvestateread to read data from vfs
file 'evolvestate'.
This enable us to restore persisted state data, and allows us to support a continued
keywork to implement evolve state.

Patch

diff --git a/hgext/evolve.py b/hgext/evolve.py
--- a/hgext/evolve.py
+++ b/hgext/evolve.py
@@ -3686,3 +3686,9 @@ 
 def _evolvestatewrite(repo, data):
     repo.vfs.write('evolvestate',
                     '|'.join([data['orig'], data['dest'], data['commitmsg']]))
+
+def _evolvestateread(repo):
+    orig, dest, commitmsg = repo.vfs.read('evolvestate').split('|')
+    return { 'orig': orig,
+             'dest': dest,
+             'commitmsg': commitmsg, }