dirstate: improve docstring formatting
authorMartin Geisler <mg@lazybytes.net>
Sun, 27 Dec 2009 23:24:05 +0100
changeset 10145 aec936051734
parent 10144 69a974125938
child 10146 9c59cdafcc24
dirstate: improve docstring formatting Triple-quoted strings are easier to spot than single-quoted strings.
mercurial/dirstate.py
--- a/mercurial/dirstate.py	Thu Dec 24 18:53:36 2009 +0200
+++ b/mercurial/dirstate.py	Sun Dec 27 23:24:05 2009 +0100
@@ -38,9 +38,12 @@
 class dirstate(object):
 
     def __init__(self, opener, ui, root):
-        '''Create a new dirstate object.  opener is an open()-like callable
-        that can be used to open the dirstate file; root is the root of the
-        directory tracked by the dirstate.'''
+        '''Create a new dirstate object.
+
+        opener is an open()-like callable that can be used to open the
+        dirstate file; root is the root of the directory tracked by
+        the dirstate.
+        '''
         self._opener = opener
         self._root = root
         self._rootdir = os.path.join(root, '')
@@ -175,6 +178,7 @@
 
     def __getitem__(self, key):
         '''Return the current state of key (a filename) in the dirstate.
+
         States are:
           n  normal
           m  needs merging
@@ -227,8 +231,7 @@
         self._dirty = False
 
     def copy(self, source, dest):
-        """Mark dest as a copy of source. Unmark dest if source is None.
-        """
+        """Mark dest as a copy of source. Unmark dest if source is None."""
         if source == dest:
             return
         self._dirty = True
@@ -266,7 +269,7 @@
             _incdirs(self._dirs, f)
 
     def normal(self, f):
-        'mark a file normal and clean'
+        '''Mark a file normal and clean.'''
         self._dirty = True
         self._addpath(f)
         s = os.lstat(self._join(f))
@@ -275,7 +278,7 @@
             del self._copymap[f]
 
     def normallookup(self, f):
-        'mark a file normal, but possibly dirty'
+        '''Mark a file normal, but possibly dirty.'''
         if self._pl[1] != nullid and f in self._map:
             # if there is a merge going on and the file was either
             # in state 'm' or dirty before being removed, restore that state.
@@ -298,7 +301,7 @@
             del self._copymap[f]
 
     def normaldirty(self, f):
-        'mark a file normal, but dirty'
+        '''Mark a file normal, but dirty.'''
         self._dirty = True
         self._addpath(f)
         self._map[f] = ('n', 0, -2, -1)
@@ -306,7 +309,7 @@
             del self._copymap[f]
 
     def add(self, f):
-        'mark a file added'
+        '''Mark a file added.'''
         self._dirty = True
         self._addpath(f, True)
         self._map[f] = ('a', 0, -1, -1)
@@ -314,7 +317,7 @@
             del self._copymap[f]
 
     def remove(self, f):
-        'mark a file removed'
+        '''Mark a file removed.'''
         self._dirty = True
         self._droppath(f)
         size = 0
@@ -329,7 +332,7 @@
             del self._copymap[f]
 
     def merge(self, f):
-        'mark a file merged'
+        '''Mark a file merged.'''
         self._dirty = True
         s = os.lstat(self._join(f))
         self._addpath(f)
@@ -338,7 +341,7 @@
             del self._copymap[f]
 
     def forget(self, f):
-        'forget a file'
+        '''Forget a file.'''
         self._dirty = True
         try:
             self._droppath(f)