[revised PATCH stable] document 'default' and 'default-push' in paths docstring

Faheem Mitha faheem at email.unc.edu
Mon Apr 26 14:19:22 CDT 2010


On Fri, 16 Apr 2010 21:12:06 +0000 (UTC), Faheem Mitha <faheem at email.unc.edu> wrote:
> Timeless and myself fiddled with this a bit more yesterday. We also
> used a suggestion from hstuart. The result was below. I was meaning to
> post this, but Martin already pushed the previous version to crew. :-)
>
> Anyway, a couple of things.
>
> 1) timeless observed that default and default-push aren't just used
> for pull and push. incoming and outgoing use them too, hence the
> wording. Does anything else use these? If not, perhaps the wording
> should be more precise, ie.
>
> "fallbacks for incoming (pull, incoming) and outgoing (push, outgoing)
> operations."
>
> The duplicate usage of incoming and outgoing is a bit unfortunate
> here, perhaps different words?
>
> 2) timeless also suggested writing tests for usage of default and
> default-push. There are tests for push using default-push and default
> when push is not set, but I didn't see anything for pull when default
> is set, or for incoming and outgoing when default / default-push is
> set. Opinions about adding these?
>
>                                                      Regards, Faheem.

Revised version:

# HG changeset patch
# User Faheem Mitha <faheem at email.unc.edu>
# Date 1272309246 -19800
# Branch stable
# Node ID d31fc0ca2c29f85470028c6244a1dff4c06f5237
# Parent  bb377a311109b472dee42a84e196d070173a7a70
Revised documentation of 'default' and 'default-push' in paths docstring.

This patch was a collaborative effort between faheem, mg, timeless and
ilowe.

# HG changeset patch
# User Faheem Mitha <faheem at email.unc.edu>
# Date 1272309246 -19800
# Branch stable
# Node ID d31fc0ca2c29f85470028c6244a1dff4c06f5237
# Parent  bb377a311109b472dee42a84e196d070173a7a70
Revised documentation of 'default' and 'default-push' in paths docstring.

This patch was a collaborative effort between faheem, mg, timeless and
ilowe.

diff -r bb377a311109 -r d31fc0ca2c29 mercurial/commands.py
--- a/mercurial/commands.py	Mon Apr 26 14:40:34 2010 +0200
+++ b/mercurial/commands.py	Tue Apr 27 00:44:06 2010 +0530
@@ -2349,10 +2349,16 @@
     Path names are defined in the [paths] section of /etc/mercurial/hgrc
     and $HOME/.hgrc. If run inside a repository, .hg/hgrc is used, too.
 
-    The names 'default' and 'default-push' have a special meaning.
-    They are the locations used when pulling and pushing respectively
-    unless a location is specified. When cloning a repository, the
-    clone source is written as 'default' in .hg/hgrc.
+    The path names ``default`` and ``default-push`` have a special
+    meaning.  When performing a push or pull operation, they are used
+    as fallbacks if no location is specified on the command-line.
+    When ``default-push`` is set, it will be used for push and
+    ``default`` will be used for pull; otherwise ``default`` is used
+    as the fallback for both.  When cloning a repository, the clone
+    source is written as ``default`` in ``.hg/hgrc``.  Note that
+    ``default`` and ``default-push`` apply to all inbound (e.g. ``hg
+    incoming``) and outbound (e.g. ``hg outgoing``, ``hg email`` and
+    ``hg bundle``) operations.
 
     See 'hg help urls' for more information.
     """



More information about the Mercurial-devel mailing list