changeset 21213:004267ce0338 stable

merge with i18n
author Matt Mackall <mpm@selenic.com>
date Thu, 01 May 2014 13:42:12 -0500
parents 799c494189a9 (diff) b7fc9c6df13c (current diff)
children 0952904dc1e5
files
diffstat 14 files changed, 74 insertions(+), 25 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/revsetbenchmarks.py	Wed Apr 30 23:20:46 2014 +0900
+++ b/contrib/revsetbenchmarks.py	Thu May 01 13:42:12 2014 -0500
@@ -22,7 +22,7 @@
     proc = Popen(*args, **kwargs)
     output, error = proc.communicate()
     if proc.returncode != 0:
-        raise CalledProcessError(proc.returncode, ' '.join(args))
+        raise CalledProcessError(proc.returncode, ' '.join(args[0]))
     return output
 
 def update(rev):
--- a/contrib/revsetbenchmarks.txt	Wed Apr 30 23:20:46 2014 +0900
+++ b/contrib/revsetbenchmarks.txt	Thu May 01 13:42:12 2014 -0500
@@ -14,3 +14,7 @@
 min(0::)
 roots((tip~100::) - (tip~100::tip))
 ::p1(p1(tip))::
+public()
+:10000 and public()
+draft()
+:10000 and draft()
--- a/hgext/largefiles/overrides.py	Wed Apr 30 23:20:46 2014 +0900
+++ b/hgext/largefiles/overrides.py	Thu May 01 13:42:12 2014 -0500
@@ -270,6 +270,9 @@
         pats = set(p)
         # TODO: handling of patterns in both cases below
         if m._cwd:
+            if os.path.isabs(m._cwd):
+                # TODO: handle largefile magic when invoked from other cwd
+                return matchandpats
             back = (m._cwd.count('/') + 1) * '../'
             pats.update(back + lfutil.standin(m._cwd + '/' + f) for f in p)
         else:
--- a/hgext/rebase.py	Wed Apr 30 23:20:46 2014 +0900
+++ b/hgext/rebase.py	Thu May 01 13:42:12 2014 -0500
@@ -228,15 +228,17 @@
             elif srcf:
                 src = scmutil.revrange(repo, [srcf])
                 if not src:
-                    raise util.Abort(_('empty "source" revision set - '
-                                       'nothing to rebase'))
+                    ui.status(_('empty "source" revision set - '
+                                'nothing to rebase\n'))
+                    return 1
                 rebaseset = repo.revs('(%ld)::', src)
                 assert rebaseset
             else:
                 base = scmutil.revrange(repo, [basef or '.'])
                 if not base:
-                    raise util.Abort(_('empty "base" revision set - '
-                                       "can't compute rebase set"))
+                    ui.status(_('empty "base" revision set - '
+                                "can't compute rebase set\n"))
+                    return 1
                 rebaseset = repo.revs(
                     '(children(ancestor(%ld, %d)) and ::(%ld))::',
                     base, dest, base)
--- a/mercurial/commands.py	Wed Apr 30 23:20:46 2014 +0900
+++ b/mercurial/commands.py	Thu May 01 13:42:12 2014 -0500
@@ -3110,10 +3110,14 @@
     # check for ancestors of dest branch
     crev = repo['.'].rev()
     ancestors = repo.changelog.ancestors([crev], inclusive=True)
+    # Cannot use x.remove(y) on smart set, this has to be a list.
+    # XXX make this lazy in the future
+    revs = list(revs)
     # don't mutate while iterating, create a copy
     for rev in list(revs):
         if rev in ancestors:
             ui.warn(_('skipping ancestor revision %s\n') % rev)
+            # XXX remove on list is slow
             revs.remove(rev)
     if not revs:
         return -1
--- a/mercurial/context.py	Wed Apr 30 23:20:46 2014 +0900
+++ b/mercurial/context.py	Thu May 01 13:42:12 2014 -0500
@@ -394,7 +394,7 @@
         return filectx(self._repo, path, fileid=fileid,
                        changectx=self, filelog=filelog)
 
-    def ancestor(self, c2):
+    def ancestor(self, c2, warn=False):
         """
         return the "best" ancestor context of self and c2
         """
@@ -415,12 +415,13 @@
                     break
             else:
                 anc = self._repo.changelog.ancestor(self._node, n2)
-            self._repo.ui.status(
-                (_("note: using %s as ancestor of %s and %s\n") %
-                 (short(anc), short(self._node), short(n2))) +
-                ''.join(_("      alternatively, use --config "
-                          "merge.preferancestor=%s\n") %
-                        short(n) for n in sorted(cahs) if n != anc))
+            if warn:
+                self._repo.ui.status(
+                    (_("note: using %s as ancestor of %s and %s\n") %
+                     (short(anc), short(self._node), short(n2))) +
+                    ''.join(_("      alternatively, use --config "
+                              "merge.preferancestor=%s\n") %
+                            short(n) for n in sorted(cahs) if n != anc))
         return changectx(self._repo, anc)
 
     def descendant(self, other):
--- a/mercurial/merge.py	Wed Apr 30 23:20:46 2014 +0900
+++ b/mercurial/merge.py	Thu May 01 13:42:12 2014 -0500
@@ -992,7 +992,7 @@
                 cahs = repo.changelog.commonancestorsheads(p1.node(), p2.node())
                 pas = [repo[anc] for anc in (sorted(cahs) or [nullid])]
             else:
-                pas = [p1.ancestor(p2)]
+                pas = [p1.ancestor(p2, warn=True)]
 
         fp1, fp2, xp1, xp2 = p1.node(), p2.node(), str(p1), str(p2)
 
--- a/mercurial/revset.py	Wed Apr 30 23:20:46 2014 +0900
+++ b/mercurial/revset.py	Thu May 01 13:42:12 2014 -0500
@@ -2783,9 +2783,10 @@
             for r in iterrange:
                 yield r
 
-    def __contains__(self, x):
-        return self._contained(x) and not (self._hiddenrevs and rev in
-                self._hiddenrevs)
+    def __contains__(self, rev):
+        return (((self._end < rev <= self._start)
+                  or (self._start <= rev < self._end))
+                and not (self._hiddenrevs and rev in self._hiddenrevs))
 
     def __nonzero__(self):
         for r in self:
@@ -2796,9 +2797,9 @@
         if isinstance(x, baseset):
             x = x.set()
         if self._start <= self._end:
-            return orderedlazyset(self, lambda r: r in x)
+            return orderedlazyset(self, x.__contains__)
         else:
-            return orderedlazyset(self, lambda r: r in x, ascending=False)
+            return orderedlazyset(self, x.__contains__, ascending=False)
 
     def __sub__(self, x):
         if isinstance(x, baseset):
@@ -2821,8 +2822,10 @@
             return abs(self._end - self._start)
         else:
             count = 0
+            start = self._start
+            end = self._end
             for rev in self._hiddenrevs:
-                if self._contained(rev):
+                if (end < rev <= start) or (start <= rev and rev < end):
                     count += 1
             return abs(self._end - self._start) - count
 
--- a/mercurial/transaction.py	Wed Apr 30 23:20:46 2014 +0900
+++ b/mercurial/transaction.py	Thu May 01 13:42:12 2014 -0500
@@ -220,6 +220,7 @@
         if self.count != 0:
             return
         self.file.close()
+        self.backupsfile.close()
         self.entries = []
         if self.after:
             self.after()
@@ -243,6 +244,7 @@
         self.count = 0
         self.usages = 0
         self.file.close()
+        self.backupsfile.close()
 
         if self.onabort is not None:
             self.onabort()
--- a/tests/hghave.py	Wed Apr 30 23:20:46 2014 +0900
+++ b/tests/hghave.py	Thu May 01 13:42:12 2014 -0500
@@ -259,6 +259,10 @@
 def has_serve():
     return os.name != 'nt' # gross approximation
 
+def has_test_repo():
+    t = os.environ["TESTDIR"]
+    return os.path.isdir(os.path.join(t, "..", ".hg"))
+
 def has_tic():
     try:
         import curses
@@ -317,6 +321,7 @@
     "svn-bindings": (has_svn_bindings, "subversion python bindings"),
     "symlink": (has_symlink, "symbolic links"),
     "system-sh": (has_system_sh, "system() uses sh"),
+    "test-repo": (has_test_repo, "running tests from repository"),
     "tic": (has_tic, "terminfo compiler and curses module"),
     "tla": (has_tla, "GNU Arch tla client"),
     "unix-permissions": (has_unix_permissions, "unix-style permissions"),
--- a/tests/test-check-pyflakes.t	Wed Apr 30 23:20:46 2014 +0900
+++ b/tests/test-check-pyflakes.t	Thu May 01 13:42:12 2014 -0500
@@ -1,8 +1,10 @@
-  $ "$TESTDIR/hghave" pyflakes || exit 80
+#if test-repo pyflakes
+
   $ cd "`dirname "$TESTDIR"`"
 
 run pyflakes on all tracked files ending in .py or without a file ending
 (skipping binary file random-seed)
+
   $ hg manifest 2>/dev/null | egrep "\.py$|^[^.]*$" | grep -v /random_seed$ \
   > | xargs pyflakes 2>/dev/null | "$TESTDIR/filterpyflakes.py"
   contrib/win32/hgwebdir_wsgi.py:*: 'win32traceutil' imported but unused (glob)
@@ -16,4 +18,4 @@
   tests/hghave.py:*: 'ssl' imported but unused (glob)
   contrib/win32/hgwebdir_wsgi.py:93: 'from isapi.install import *' used; unable to detect undefined names (glob)
   
-
+#endif
--- a/tests/test-graft.t	Wed Apr 30 23:20:46 2014 +0900
+++ b/tests/test-graft.t	Thu May 01 13:42:12 2014 -0500
@@ -571,3 +571,14 @@
   date:        Thu Jan 01 00:00:00 1970 +0000
   summary:     2
   
+
+graft works on complex revset
+
+  $ hg graft 'origin(13) or destination(origin(13))'
+  skipping ancestor revision 21
+  skipping ancestor revision 22
+  skipping revision 2 (already grafted to 22)
+  grafting revision 7
+  grafting revision 13
+  grafting revision 19
+  merging b
--- a/tests/test-largefiles.t	Wed Apr 30 23:20:46 2014 +0900
+++ b/tests/test-largefiles.t	Thu May 01 13:42:12 2014 -0500
@@ -773,6 +773,18 @@
   @  7:daea875e9014
   |
   $ cd ..
+
+Test log from outside repo
+
+  $ hg log  b/sub -T '{rev}:{node|short}  {desc|firstline}\n'
+  6:4355d653f84f  edit files yet again
+  5:9d5af5072dbd  edit files again
+  4:74c02385b94c  move files
+  1:ce8896473775  edit files
+  0:30d30fe6a5be  add files
+
+Test clone at revision
+
   $ hg clone a -r 3 c
   adding changesets
   adding manifests
--- a/tests/test-rebase-parameters.t	Wed Apr 30 23:20:46 2014 +0900
+++ b/tests/test-rebase-parameters.t	Thu May 01 13:42:12 2014 -0500
@@ -84,12 +84,12 @@
   [1]
 
   $ hg rebase --source '1 & !1'
-  abort: empty "source" revision set - nothing to rebase
-  [255]
+  empty "source" revision set - nothing to rebase
+  [1]
 
   $ hg rebase --base '1 & !1'
-  abort: empty "base" revision set - can't compute rebase set
-  [255]
+  empty "base" revision set - can't compute rebase set
+  [1]
 
   $ hg rebase
   nothing to rebase - working directory parent is also destination