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

Faheem Mitha faheem at email.unc.edu
Fri Apr 16 16:12:06 CDT 2010


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.

# HG changeset patch
# User Faheem Mitha <faheem at email.unc.edu>
# Date 1271451531 -19800
# Node ID 626713d803ba28acc81eb55cc825a7361a5130b7
# Parent  a8486615eece30274b3f8b4d93daf3d37af65b9e
Document 'default' and 'default-push' in paths docstring

diff -r a8486615eece -r 626713d803ba mercurial/commands.py
--- a/mercurial/commands.py     Fri Apr 16 22:14:14 2010 +0200
+++ b/mercurial/commands.py     Sat Apr 17 02:28:51 2010 +0530
@@ -2375,10 +2375,13 @@
     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.
+    For operations requiring a location, if one is not specified, the
+    path names 'default' and 'default-push', if defined, are used as
+    fallbacks for incoming and outgoing operations, respectively. When
+    cloning a repository, the clone source is written as 'default' in
+    .hg/hgrc. If 'default' is defined and 'default-push' is not,
+    'default' is used as a fallback for both incoming and outgoing
+    operations.

     See 'hg help urls' for more information.
     """



More information about the Mercurial-devel mailing list