Commits

Brendan Cully  committed cecea9f

Clean up docstring handling in diff override. Add better docs.

  • Participants
  • Parent commits 86ccf78

Comments (0)

Files changed (1)

             os.unlink(bundle)
 
 def diff(orig, ui, repo, *pats, **opts):
+    """
+    [rdiff]
+    If the first argument to the diff command is a remote repository URL,
+    the diff will be performed against that URL. If revision arguments are
+    given, the first revision is the revision in the source repository,
+    and the second revision is looked up in the destination.
+    
+    The --reverse flag cause the direction of the diff to be reversed.
+    """
     url = None
     rrev = None
     if pats:
 
     wrap.__doc__ = getattr(origfn, '__doc__')
     wrap.__module__ = getattr(origfn, '__module__')
-    if wrapper.__doc__:
-        if wrapper.__doc__.startswith('\n'):
-            wrap.__doc__ += wrapper.__doc__
-        else:
-            wrap.__doc__ = wrapper.__doc__
 
     newentry = list(entry)
     newentry[0] = wrap
     table[key] = tuple(newentry)
-    return entry
+    return newentry
 
 def uisetup(ui):
     rdiffopts = [('', 'reverse', None, _('reverse patch direction'))] + \
         commands.remoteopts
 
+    odoc = diff.__doc__
     entry = wrapcommand(commands.table, 'diff', diff)
+    entry[0].__doc__ += odoc
     entry[1].extend(rdiffopts)