Merge with stable
authorChristian Ebert <blacktrash@gmx.net>
Sun, 13 May 2012 14:39:47 +0100
changeset 1074 6c7d0e38c0c2
parent 1066 bd418e7e2d29 (current diff)
parent 1073 bc8e57c1ae32 (diff)
child 1075 9c31017cb4b2
Merge with stable
--- a/hgkw/keyword.py	Sun Apr 29 16:58:42 2012 +0100
+++ b/hgkw/keyword.py	Sun May 13 14:39:47 2012 +0100
@@ -238,7 +238,7 @@
     def iskwfile(self, cand, ctx):
         '''Returns subset of candidates which are configured for keyword
         expansion but are not symbolic links.'''
-        return [f for f in cand if self.match(f) and not 'l' in ctx.flags(f)]
+        return [f for f in cand if self.match(f) and 'l' not in ctx.flags(f)]
 
     def overwrite(self, ctx, candidates, lookup, expand, rekw=False):
         '''Overwrites selected files expanding/shrinking keywords.'''
@@ -651,7 +651,7 @@
             return kwt.match(source)
 
         candidates = [f for f in repo.dirstate.copies() if
-                      not 'l' in wctx.flags(f) and haskwsource(f)]
+                      'l' not in wctx.flags(f) and haskwsource(f)]
         kwt.overwrite(wctx, candidates, False, False)
 
     def kw_dorecord(orig, ui, repo, commitfunc, *pats, **opts):
@@ -680,7 +680,7 @@
         # not make sense
         if (fctx._filerev is None and
             (self._repo._encodefilterpats or
-             kwt.match(fctx.path()) and not 'l' in fctx.flags() or
+             kwt.match(fctx.path()) and 'l' not in fctx.flags() or
              self.size() - 4 == fctx.size()) or
             self.size() == fctx.size()):
             return self._filelog.cmp(self._filenode, fctx.data())
--- a/tests/hghave	Sun Apr 29 16:58:42 2012 +0100
+++ b/tests/hghave	Sun May 13 14:39:47 2012 +0100
@@ -31,14 +31,14 @@
 def has_bzr():
     try:
         import bzrlib
-        return bzrlib.__doc__ != None
+        return bzrlib.__doc__ is not None
     except ImportError:
         return False
 
 def has_bzr114():
     try:
         import bzrlib
-        return (bzrlib.__doc__ != None
+        return (bzrlib.__doc__ is not None
                 and bzrlib.version_info[:2] >= (1, 14))
     except ImportError:
         return False
@@ -60,7 +60,7 @@
         os.close(fd)
         os.remove(path)
         return True
-    except:
+    except (IOError, OSError):
         return False
 
 def has_executablebit():
@@ -93,7 +93,7 @@
         try:
             s2 = os.stat(p2)
             return s2 == s1
-        except:
+        except OSError:
             return False
     finally:
         os.remove(path)
@@ -106,7 +106,7 @@
         return False
 
 def has_fifo():
-    return hasattr(os, "mkfifo")
+    return getattr(os, "mkfifo", None) is not None
 
 def has_cacheable_fs():
     from mercurial import util
@@ -165,10 +165,11 @@
         return False
 
 def has_p4():
-    return matchoutput('p4 -V', r'Rev\. P4/') and matchoutput('p4d -V', r'Rev\. P4D/')
+    return (matchoutput('p4 -V', r'Rev\. P4/') and
+            matchoutput('p4d -V', r'Rev\. P4D/'))
 
 def has_symlink():
-    if not hasattr(os, "symlink"):
+    if getattr(os, "symlink", None) is None:
         return False
     name = tempfile.mktemp(dir=".", prefix='hg-checklink-')
     try:
--- a/tests/run-tests.py	Sun Apr 29 16:58:42 2012 +0100
+++ b/tests/run-tests.py	Sun May 13 14:39:47 2012 +0100
@@ -860,7 +860,7 @@
         tf = open(testpath)
         firstline = tf.readline().rstrip()
         tf.close()
-    except:
+    except IOError:
         firstline = ''
     lctest = test.lower()
 
@@ -1187,6 +1187,7 @@
     os.environ['http_proxy'] = ''
     os.environ['no_proxy'] = ''
     os.environ['NO_PROXY'] = ''
+    os.environ['TERM'] = 'xterm'
 
     # unset env related to hooks
     for k in os.environ.keys():
--- a/tests/test-keyword.t	Sun Apr 29 16:58:42 2012 +0100
+++ b/tests/test-keyword.t	Sun May 13 14:39:47 2012 +0100
@@ -558,6 +558,7 @@
   $ hg --debug commit -ma2c -d '1 0' -u 'User Name <user@example.com>'
   c
    c: copy a:0045e12f6c5791aac80ca6cbfd97709a88307292
+  removing unknown node 40a904bbbe4c from 1-phase boundary
   overwriting c expanding keywords
   committed changeset 2:25736cf2f5cbe41f6be4e6784ef6ecf9f3bbcc7d
   $ cat a c
@@ -722,6 +723,7 @@
 
   $ hg --debug commit -l log -d '2 0' -u 'User Name <user@example.com>'
   a
+  removing unknown node 40a904bbbe4c from 1-phase boundary
   overwriting a expanding keywords
   committed changeset 2:bb948857c743469b22bbf51f7ec8112279ca5d83
   $ rm log