Patchwork [1,of,4,evolve-ext-V3] evolve: add new method _evolvestatewrite

login
register
mail settings
Submitter Shusen LIU
Date Dec. 18, 2015, 1 p.m.
Message ID <8e8491c49ddeca5f70de.1450443646@dev1221.lla1.facebook.com>
Download mbox | patch
Permalink /patch/12149/
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 1450307795 28800
#      Wed Dec 16 15:16:35 2015 -0800
# Node ID 8e8491c49ddeca5f70de118b03ec74003d17c7ce
# Parent  0ce293362d9b8536cc0cd01568b168352be948a6
evolve: add new method _evolvestatewrite

This patch introduces a new method _evolvestatewrite to write data into vfs file 'evolvestate'.
This enable us to persist 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
@@ -3682,3 +3682,7 @@ 
         repo._bookmarks[book] = dest.node()
     if oldbookmarks or destbookmarks:
         repo._bookmarks.recordchange(tr)
+
+def _evolvestatewrite(repo, data):
+    repo.vfs.write('evolvestate',
+                    '|'.join([data['orig'], data['dest'], data['commitmsg']]))