Mercurial > hg-stable
changeset 20588:4c4cd64c754b stable
merge: move merge state file path into a constant
We are about to change the format. Having the file path in a single place make
it easier to update the filename for the new version.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Tue, 25 Feb 2014 17:14:49 -0800 |
parents | de48422df393 |
children | 31993cd23b11 |
files | mercurial/merge.py |
diffstat | 1 files changed, 3 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/merge.py Thu Feb 27 22:56:42 2014 +0530 +++ b/mercurial/merge.py Tue Feb 25 17:14:49 2014 -0800 @@ -13,6 +13,7 @@ class mergestate(object): '''track 3-way merge state of individual files''' + statepath = "merge/state" def __init__(self, repo): self._repo = repo self._dirty = False @@ -26,7 +27,7 @@ def _read(self): self._state = {} try: - f = self._repo.opener("merge/state") + f = self._repo.opener(self.statepath) for i, l in enumerate(f): if i == 0: self._local = bin(l[:-1]) @@ -40,7 +41,7 @@ self._dirty = False def commit(self): if self._dirty: - f = self._repo.opener("merge/state", "w") + f = self._repo.opener(self.statepath, "w") f.write(hex(self._local) + "\n") for d, v in self._state.iteritems(): f.write("\0".join([d] + v) + "\n")