Patchwork [04,of,16,V3] dirstate: update and move documentation of status types to status class

login
register
mail settings
Submitter Martin von Zweigbergk
Date Oct. 10, 2014, 10:20 p.m.
Message ID <8553c665e37bc353220e.1412979636@handduk2.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/6194/
State Superseded
Headers show

Comments

Martin von Zweigbergk - Oct. 10, 2014, 10:20 p.m.
# HG changeset patch
# User Martin von Zweigbergk <martinvonz@gmail.com>
# Date 1412961275 25200
#      Fri Oct 10 10:14:35 2014 -0700
# Node ID 8553c665e37bc353220e7b82aed1c5b5de9a5e98
# Parent  bc97ca8ffcc516f2eb051a62bbfddf50f7e7f56a
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.

Patch

diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py
--- a/mercurial/dirstate.py
+++ b/mercurial/dirstate.py
@@ -41,30 +41,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):
@@ -847,28 +856,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
         '''