From patchwork Sun Oct 12 05:44:21 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [04, of, 17, V4] dirstate: update and move documentation of status types to status class From: Martin von Zweigbergk X-Patchwork-Id: 6220 Message-Id: To: mercurial-devel@selenic.com Date: Sat, 11 Oct 2014 22:44:21 -0700 # HG changeset patch # User Martin von Zweigbergk # Date 1412961275 25200 # Fri Oct 10 10:14:35 2014 -0700 # Node ID ba0e941771480511e8dee5b5c3c303f8de668ecc # Parent cd8ad3e2855507f93bc5a2fb645806c22be7b946 dirstate: update and move documentation of status types to status class The various status types are currently documented on the dirstate.status() method. Now that we have a class for the status types, it makese sense to document the status types there instead. Only leave the bits related to lookup/unsure in the status() method documentation. diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py --- a/mercurial/dirstate.py +++ b/mercurial/dirstate.py @@ -40,30 +40,39 @@ @property def modified(self): + '''files that have been modified''' return self[0] @property def added(self): + '''files that have been added''' return self[1] @property def removed(self): + '''files that have been removed''' return self[2] @property def deleted(self): + '''files that are in the dirstate, but have been deleted from the + working copy (aka "missing") + ''' return self[3] @property def unknown(self): + '''files not in the dirstate that are not ignored''' return self[4] @property def ignored(self): + '''files not in the dirstate that are ignored (by _dirignore())''' return self[5] @property def clean(self): + '''files that have not been modified''' return self[6] def __repr__(self, *args, **kwargs): @@ -846,28 +855,17 @@ def status(self, match, subrepos, ignored, clean, unknown): '''Determine the status of the working copy relative to the - dirstate and return a nested tuple of lists (unsure, (modified, added, - removed, deleted, unknown, ignored, clean)), where: + dirstate and return a pair of (unsure, status), where status is of type + dirstate.status and: unsure: files that might have been modified since the dirstate was written, but need to be read to be sure (size is the same but mtime differs) - modified: + status.modified: files that have definitely been modified since the dirstate was written (different size or mode) - added: - files that have been explicitly added with hg add - removed: - files that have been explicitly removed with hg remove - deleted: - files that have been deleted through other means ("missing") - unknown: - files not in the dirstate that are not ignored - ignored: - files not in the dirstate that are ignored - (by _dirignore()) - clean: + status.clean: files that have definitely not been modified since the dirstate was written '''