Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/merge.py @ 26991:2ddc92bae4a7
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.
author | Siddharth Agarwal <sid0@fb.com> |
---|---|
date | Tue, 17 Nov 2015 13:55:30 -0800 |
parents | 11b1832db8ae |
children | 3185c01c551c |
comparison
equal
deleted
inserted
replaced
26990:11b1832db8ae | 26991:2ddc92bae4a7 |
---|---|
79 def clean(repo, node=None, other=None): | 79 def clean(repo, node=None, other=None): |
80 """Initialize a brand new merge state, removing any existing state on | 80 """Initialize a brand new merge state, removing any existing state on |
81 disk.""" | 81 disk.""" |
82 ms = mergestate(repo) | 82 ms = mergestate(repo) |
83 ms.reset(node, other) | 83 ms.reset(node, other) |
84 return ms | |
85 | |
86 @staticmethod | |
87 def read(repo): | |
88 """Initialize the merge state, reading it from disk.""" | |
89 ms = mergestate(repo) | |
84 return ms | 90 return ms |
85 | 91 |
86 def __init__(self, repo): | 92 def __init__(self, repo): |
87 self._repo = repo | 93 self._repo = repo |
88 self._dirty = False | 94 self._dirty = False |