# HG changeset patch # User Siddharth Agarwal # Date 2015-11-17 21:55:30 # Node ID 2ddc92bae4a719da39da1c3bbbb31c83846675ab # Parent 11b1832db8ae6e98474e4c21556a33518dfe3842 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