Fix getnode doc, add doc for patch.diff monkey
authorChristian Ebert <blacktrash@gmx.net>
Fri, 15 Feb 2008 17:54:58 +0100
changeset 415 d1026365eff6
parent 413 1b6610abf538
child 416 b69dca43ef08
Fix getnode doc, add doc for patch.diff monkey
hgkw/keyword.py
--- a/hgkw/keyword.py	Thu Feb 14 18:50:00 2008 +0100
+++ b/hgkw/keyword.py	Fri Feb 15 17:54:58 2008 +0100
@@ -121,7 +121,8 @@
 
 def _kw_diff(repo, node1=None, node2=None, files=None, match=util.always,
              fp=None, changes=None, opts=None):
-    # only expand if comparing against working dir
+    '''Monkeypatch patch.diff to avoid expansion except when
+    comparing against working dir.'''
     if node2 is not None:
         kwx['templater'].matcher = util.never
     elif node1 is not None and node1 != repo.changectx().node():
@@ -184,7 +185,8 @@
                                               False, '', False)
 
     def getnode(self, path, fnode):
-        '''Derives changenode from file context.'''
+        '''Derives changenode from file path and filenode.'''
+        # used by kwfilelog.read and kwexpand
         c = context.filectx(self.repo, path, fileid=fnode)
         return c.node()