# HG changeset patch # User Martin Geisler # Date 2009-12-27 22:24:05 # Node ID aec9360517340b0d1018b213018475411c0456ad # Parent 69a974125938c11184598b99a51aaeba6f6323f9 dirstate: improve docstring formatting Triple-quoted strings are easier to spot than single-quoted strings. diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py --- a/mercurial/dirstate.py +++ b/mercurial/dirstate.py @@ -38,9 +38,12 @@ def _decdirs(dirs, path): 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 @@ class dirstate(object): 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 @@ class dirstate(object): 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 @@ class dirstate(object): _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 @@ class dirstate(object): 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 @@ class dirstate(object): 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 @@ class dirstate(object): 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 @@ class dirstate(object): 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 @@ class dirstate(object): 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 @@ class dirstate(object): del self._copymap[f] def forget(self, f): - 'forget a file' + '''Forget a file.''' self._dirty = True try: self._droppath(f)