merge with stable stable
authorWagner Bruna <wbruna@yahoo.com>
Sat, 10 Jul 2010 14:01:10 -0300
branchstable
changeset 11527 89ef60af92e9
parent 11526 ee3e5e3210d0 (current diff)
parent 11523 dec57aa0f8ca (diff)
child 11528 6f44bd4cc4f2
merge with stable
--- a/contrib/check-code.py	Thu Jul 08 15:36:14 2010 -0300
+++ b/contrib/check-code.py	Sat Jul 10 14:01:10 2010 -0300
@@ -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	Thu Jul 08 15:36:14 2010 -0300
+++ b/hgext/convert/__init__.py	Sat Jul 10 14:01:10 2010 -0300
@@ -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	Thu Jul 08 15:36:14 2010 -0300
+++ b/mercurial/commands.py	Sat Jul 10 14:01:10 2010 -0300
@@ -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	Thu Jul 08 15:36:14 2010 -0300
+++ b/mercurial/extensions.py	Sat Jul 10 14:01:10 2010 -0300
@@ -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	Thu Jul 08 15:36:14 2010 -0300
+++ b/tests/test-convert.out	Sat Jul 10 14:01:10 2010 -0300
@@ -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