comparison mercurial/context.py @ 21396:3925d9460d27

committablectx: move status to workingctx This method was accidentally placed into the committablectx class. It contains logic for querying the dirstate so we move it to the correct class.
author Sean Farley <sean.michael.farley@gmail.com>
date Tue, 11 Mar 2014 18:28:09 -0500
parents f251b92d9ed9
children 38743c59f3f8
comparison
equal deleted inserted replaced
21395:f251b92d9ed9 21396:3925d9460d27
929 929
930 @propertycache 930 @propertycache
931 def _date(self): 931 def _date(self):
932 return util.makedate() 932 return util.makedate()
933 933
934 def status(self, ignored=False, clean=False, unknown=False):
935 """Explicit status query
936 Unless this method is used to query the working copy status, the
937 _status property will implicitly read the status using its default
938 arguments."""
939 stat = self._repo.status(ignored=ignored, clean=clean, unknown=unknown)
940 self._unknown = self._ignored = self._clean = None
941 if unknown:
942 self._unknown = stat[4]
943 if ignored:
944 self._ignored = stat[5]
945 if clean:
946 self._clean = stat[6]
947 self._status = stat[:4]
948 return stat
949
950 def user(self): 934 def user(self):
951 return self._user or self._repo.ui.username() 935 return self._user or self._repo.ui.username()
952 def date(self): 936 def date(self):
953 return self._date 937 return self._date
954 def description(self): 938 def description(self):
1227 wlock.release() 1211 wlock.release()
1228 except error.LockError: 1212 except error.LockError:
1229 pass 1213 pass
1230 return modified, fixup 1214 return modified, fixup
1231 1215
1216 def status(self, ignored=False, clean=False, unknown=False):
1217 """Explicit status query
1218 Unless this method is used to query the working copy status, the
1219 _status property will implicitly read the status using its default
1220 arguments."""
1221 stat = self._repo.status(ignored=ignored, clean=clean, unknown=unknown)
1222 self._unknown = self._ignored = self._clean = None
1223 if unknown:
1224 self._unknown = stat[4]
1225 if ignored:
1226 self._ignored = stat[5]
1227 if clean:
1228 self._clean = stat[6]
1229 self._status = stat[:4]
1230 return stat
1231
1232 1232
1233 class committablefilectx(basefilectx): 1233 class committablefilectx(basefilectx):
1234 """A committablefilectx provides common functionality for a file context 1234 """A committablefilectx provides common functionality for a file context
1235 that wants the ability to commit, e.g. workingfilectx or memfilectx.""" 1235 that wants the ability to commit, e.g. workingfilectx or memfilectx."""
1236 def __init__(self, repo, path, filelog=None, ctx=None): 1236 def __init__(self, repo, path, filelog=None, ctx=None):