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

login
register
mail settings
Submitter Shusen LIU
Date Dec. 16, 2015, 11:45 p.m.
Message ID <8e8491c49ddeca5f70de.1450309549@dev1221.lla1.facebook.com>
Download mbox | patch
Permalink /patch/12083/
State Changes Requested
Headers show

Comments

Shusen LIU - Dec. 16, 2015, 11:45 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.
Pierre-Yves David - Dec. 18, 2015, 11:51 a.m.
On 12/16/2015 11:45 PM, Shusen LIU wrote:
> # 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.

Can we get some formal documentation about what the format looks like in 
a V2?

has a head up, once this documentation is up, there will probably be 
some discussion about that format.

(I would be fine with all function reading/writing/deleting/documenting 
in the same patch (but thanks for splitting effort here).

Thanks
Pierre-Yves David - Dec. 18, 2015, 1:55 p.m.
On 12/18/2015 11:51 AM, Pierre-Yves David wrote:
>
>
> On 12/16/2015 11:45 PM, Shusen LIU wrote:
>> # 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.
>
> Can we get some formal documentation about what the format looks like in

To clarify my request, I would like the format (content) of the 
evolvestate file (on disk) to be documented near the code that handle 
writing and parsing such file.

You can find example of such documenation here:
https://selenic.com/hg/file/tip/mercurial/obsolete.py#l250

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']]))