[PATCH 1 of 7 mergedriver] mergestate: add a constructor that reads state from disk
Siddharth Agarwal
sid0 at fb.com
Wed Nov 18 05:48:30 UTC 2015
# HG changeset patch
# User Siddharth Agarwal <sid0 at fb.com>
# Date 1447797330 28800
# Tue Nov 17 13:55:30 2015 -0800
# Node ID 225459dfc6cad40339467f2ba72b33f00709b6d6
# Parent a895afbcc1cd13e6207acbfc164d2afa8e917bb3
mergestate: add a constructor that reads state from disk
At the moment it's the same as just creating a new mergestate, but we'll soon
move the _read call out of __init__ and in here.
diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -83,6 +83,12 @@ class mergestate(object):
ms.reset(node, other)
return ms
+ @staticmethod
+ def read(repo):
+ """Initialize the merge state, reading it from disk."""
+ ms = mergestate(repo)
+ return ms
+
def __init__(self, repo):
self._repo = repo
self._dirty = False
More information about the Mercurial-devel
mailing list