D5996: committablectx: move status-related methods closer together
martinvonz (Martin von Zweigbergk)
phabricator at mercurial-scm.org
Thu Feb 21 16:47:59 UTC 2019
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.
REVISION SUMMARY
The modified()/added()/removed()/deleted() clearly belong very close
to status(). I separated them in committablectx by the new
p[12]copies() methods. This brings the close again. Sorry about the
churn.
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D5996
AFFECTED FILES
mercurial/context.py
CHANGE DETAILS
diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -1181,6 +1181,14 @@
def files(self):
return sorted(self._status.modified + self._status.added +
self._status.removed)
+ def modified(self):
+ return self._status.modified
+ def added(self):
+ return self._status.added
+ def removed(self):
+ return self._status.removed
+ def deleted(self):
+ return self._status.deleted
@propertycache
def _copies(self):
p1copies = {}
@@ -1201,14 +1209,6 @@
return self._copies[0]
def p2copies(self):
return self._copies[1]
- def modified(self):
- return self._status.modified
- def added(self):
- return self._status.added
- def removed(self):
- return self._status.removed
- def deleted(self):
- return self._status.deleted
def branch(self):
return encoding.tolocal(self._extra['branch'])
def closesbranch(self):
To: martinvonz, #hg-reviewers
Cc: mercurial-devel
More information about the Mercurial-devel
mailing list