Merge with stable
authorMartin Geisler <mg@aragost.com>
Fri, 09 Jul 2010 14:21:45 +0200
changeset 11525 f4eddec324b7
parent 11524 24965bb270b7 (current diff)
parent 11523 dec57aa0f8ca (diff)
child 11529 52874ddeb166
child 11532 f3732ab1149f
Merge with stable
mercurial/commands.py
--- a/contrib/check-code.py	Wed Jul 07 18:49:43 2010 -0400
+++ b/contrib/check-code.py	Fri Jul 09 14:21:45 2010 +0200
@@ -94,6 +94,8 @@
     (r'^\s*with\s+', "with not available in Python 2.4"),
     (r'(?<!def)\s+(any|all|format)\(',
      "any/all/format not available in Python 2.4"),
+    (r'(?<!def)\s+(callable)\(',
+     "callable not available in Python 3, use hasattr(f, '__call__')"),
     (r'if\s.*\selse', "if ... else form not available in Python 2.4"),
     (r'([\(\[]\s\S)|(\S\s[\)\]])', "gratuitous whitespace in () or []"),
 #    (r'\s\s=', "gratuitous whitespace before ="),
--- a/hgext/convert/__init__.py	Wed Jul 07 18:49:43 2010 -0400
+++ b/hgext/convert/__init__.py	Fri Jul 09 14:21:45 2010 +0200
@@ -77,22 +77,27 @@
     srcauthor=whatever string you want
 
     The filemap is a file that allows filtering and remapping of files
-    and directories. Comment lines start with '#'. Each line can
-    contain one of the following directives::
+    and directories. Each line can contain one of the following
+    directives::
+
+      include path/to/file-or-dir
+
+      exclude path/to/file-or-dir
 
-      include path/to/file
+      rename path/to/source path/to/destination
 
-      exclude path/to/file
-
-      rename from/file to/file
+    Comment lines start with '#'. A specificed path matches if it
+    equals the full relative name of a file or one of its parent
+    directories. The 'include' or 'exclude' directive with the longest
+    matching path applies, so line order does not matter.
 
     The 'include' directive causes a file, or all files under a
     directory, to be included in the destination repository, and the
     exclusion of all other files and directories not explicitly
     included. The 'exclude' directive causes files or directories to
-    be omitted. The 'rename' directive renames a file or directory. To
-    rename from a subdirectory into the root of the repository, use
-    '.' as the path to rename to.
+    be omitted. The 'rename' directive renames a file or directory if
+    is converted. To rename from a subdirectory into the root of the
+    repository, use '.' as the path to rename to.
 
     The splicemap is a file that allows insertion of synthetic
     history, letting you specify the parents of a revision. This is
--- a/mercurial/commands.py	Wed Jul 07 18:49:43 2010 -0400
+++ b/mercurial/commands.py	Fri Jul 09 14:21:45 2010 +0200
@@ -77,7 +77,8 @@
     every added file and records those similar enough as renames. This
     option takes a percentage between 0 (disabled) and 100 (files must
     be identical) as its parameter. Detecting renamed files this way
-    can be expensive.
+    can be expensive. After using this option, :hg:`status -C` can be
+    used to check which files were identified as moved or renamed.
 
     Returns 0 if all files are successfully added.
     """
--- a/mercurial/extensions.py	Wed Jul 07 18:49:43 2010 -0400
+++ b/mercurial/extensions.py	Fri Jul 09 14:21:45 2010 +0200
@@ -104,6 +104,19 @@
                 extsetup() # old extsetup with no ui argument
 
 def wrapcommand(table, command, wrapper):
+    '''Wrap the command named `command' in table
+
+    Replace command in the command table with wrapper. The wrapped command will
+    be inserted into the command table specified by the table argument.
+
+    The wrapper will be called like
+
+      wrapper(orig, *args, **kwargs)
+
+    where orig is the original (wrapped) function, and *args, **kwargs
+    are the arguments passed to it.
+    '''
+    assert hasattr(wrapper, '__call__')
     aliases, entry = cmdutil.findcmd(command, table)
     for alias, e in table.iteritems():
         if e is entry:
@@ -126,8 +139,8 @@
 def wrapfunction(container, funcname, wrapper):
     '''Wrap the function named funcname in container
 
-    It is replacing with your wrapper. The container is typically a
-    module, class, or instance.
+    Replace the funcname member in the given container with the specified
+    wrapper. The container is typically a module, class, or instance.
 
     The wrapper will be called like
 
@@ -156,10 +169,12 @@
     your end users, you should play nicely with others by using the
     subclass trick.
     '''
+    assert hasattr(wrapper, '__call__')
     def wrap(*args, **kwargs):
         return wrapper(origfn, *args, **kwargs)
 
     origfn = getattr(container, funcname)
+    assert hasattr(origfn, '__call__')
     setattr(container, funcname, wrap)
     return origfn
 
--- a/tests/test-convert.out	Wed Jul 07 18:49:43 2010 -0400
+++ b/tests/test-convert.out	Fri Jul 09 14:21:45 2010 +0200
@@ -57,21 +57,25 @@
     mapping and the line format is: srcauthor=whatever string you want
 
     The filemap is a file that allows filtering and remapping of files and
-    directories. Comment lines start with '#'. Each line can contain one of
-    the following directives:
+    directories. Each line can contain one of the following directives:
+
+      include path/to/file-or-dir
+
+      exclude path/to/file-or-dir
 
-      include path/to/file
+      rename path/to/source path/to/destination
 
-      exclude path/to/file
-
-      rename from/file to/file
+    Comment lines start with '#'. A specificed path matches if it equals the
+    full relative name of a file or one of its parent directories. The
+    'include' or 'exclude' directive with the longest matching path applies,
+    so line order does not matter.
 
     The 'include' directive causes a file, or all files under a directory, to
     be included in the destination repository, and the exclusion of all other
     files and directories not explicitly included. The 'exclude' directive
     causes files or directories to be omitted. The 'rename' directive renames
-    a file or directory. To rename from a subdirectory into the root of the
-    repository, use '.' as the path to rename to.
+    a file or directory if is converted. To rename from a subdirectory into
+    the root of the repository, use '.' as the path to rename to.
 
     The splicemap is a file that allows insertion of synthetic history,
     letting you specify the parents of a revision. This is useful if you want