Patchwork [1,of,5] cmdutil: comprehensively document the interface of export

login
register
mail settings
Submitter Augie Fackler
Date May 22, 2017, 7:09 p.m.
Message ID <eb70e8c53a2826d37744.1495480159@augie-macbookpro2.roam.corp.google.com>
Download mbox | patch
Permalink /patch/20837/
State Accepted
Headers show

Comments

Augie Fackler - May 22, 2017, 7:09 p.m.
# HG changeset patch
# User Augie Fackler <augie@google.com>
# Date 1495317484 14400
#      Sat May 20 17:58:04 2017 -0400
# Node ID eb70e8c53a2826d377448d7ce3da00ac41565fd2
# Parent  e8c043375b53b30c4b468687f08323cbeeb452ef
cmdutil: comprehensively document the interface of export

I want to make some improvements here, but in order to make future
patches easier to review I want to document the current state of the
world.
Yuya Nishihara - May 23, 2017, 1:43 p.m.
On Mon, 22 May 2017 15:09:19 -0400, Augie Fackler wrote:
> # HG changeset patch
> # User Augie Fackler <augie@google.com>
> # Date 1495317484 14400
> #      Sat May 20 17:58:04 2017 -0400
> # Node ID eb70e8c53a2826d377448d7ce3da00ac41565fd2
> # Parent  e8c043375b53b30c4b468687f08323cbeeb452ef
> cmdutil: comprehensively document the interface of export

Looks good. Queued, thanks.

Patch

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -1143,7 +1143,30 @@  extraexportmap = {}
 
 def export(repo, revs, template='hg-%h.patch', fp=None, switch_parent=False,
            opts=None, match=None):
-    '''export changesets as hg patches.'''
+    '''export changesets as hg patches
+
+    Args:
+      repo: The repository from which we're exporting revisions.
+      revs: A list of revisions to export as revision numbers.
+      template: An optional string to use for generating patch file names.
+      fp: An optional file-like object to which patches should be written.
+      switch_parent: If True, show diffs against second parent when not nullid.
+                     Default is false, which always shows diff against p1.
+      opts: diff options to use for generating the patch.
+      match: If specified, only export changes to files matching this matcher.
+
+    Returns:
+      Nothing.
+
+    Side Effect:
+      "HG Changeset Patch" data is emitted to one of the following
+      destinations:
+        fp is specified: All revs are written to the specified
+                         file-like object.
+        template specified: Each rev is written to a unique file named using
+                            the given template.
+        Neither fp nor template specified: All revs written to repo.ui.write()
+    '''
 
     total = len(revs)
     revwidth = max([len(str(rev)) for rev in revs])