changeset 14778:b069b379829a

merge with i18n
author Wagner Bruna <wbruna@softwareexpress.com.br>
date Tue, 21 Jun 2011 19:00:27 -0300
parents 640bfe96ddcf (diff) 219273cc548d (current diff)
children 96383c8242a1
files
diffstat 18 files changed, 223 insertions(+), 69 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile	Tue Jun 21 01:49:45 2011 +0400
+++ b/Makefile	Tue Jun 21 19:00:27 2011 -0300
@@ -91,7 +91,7 @@
 
 i18n/hg.pot: $(PYFILES) $(DOCFILES)
 	$(PYTHON) i18n/hggettext mercurial/commands.py \
-	  hgext/*.py hgext/*/__init__.py mercurial/revset.py \
+	  hgext/*.py hgext/*/__init__.py mercurial/fileset.py mercurial/revset.py \
 	  $(DOCFILES) > i18n/hg.pot
         # All strings marked for translation in Mercurial contain
         # ASCII characters only. But some files contain string
--- a/contrib/check-code.py	Tue Jun 21 01:49:45 2011 +0400
+++ b/contrib/check-code.py	Tue Jun 21 19:00:27 2011 -0300
@@ -178,6 +178,7 @@
     (r'[\s\(](open|file)\([^)]*\)\.',
      "always assign an opened file to a variable, and close it afterwards"),
     (r'(?i)descendent', "the proper spelling is descendAnt"),
+    (r'\.debug\(\_', "don't mark debug messages for translation"),
   ],
   # warnings
   [
--- a/hg2	Tue Jun 21 01:49:45 2011 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-#!/usr/bin/env python
-#
-# mercurial - scalable distributed SCM
-#
-# Copyright 2005-2007 Matt Mackall <mpm@selenic.com>
-#
-# This software may be used and distributed according to the terms of the
-# GNU General Public License version 2 or any later version.
-
-import os
-import sys
-
-libdir = '@LIBDIR@'
-
-if libdir != '@' 'LIBDIR' '@':
-    if not os.path.isabs(libdir):
-        libdir = os.path.join(os.path.dirname(os.path.realpath(__file__)),
-                              libdir)
-        libdir = os.path.abspath(libdir)
-    sys.path.insert(0, libdir)
-
-# enable importing on demand to reduce startup time
-try:
-    from mercurial import demandimport; demandimport.enable()
-except ImportError:
-    import sys
-    sys.stderr.write("abort: couldn't find mercurial libraries in [%s]\n" %
-                     ' '.join(sys.path))
-    sys.stderr.write("(check your install and PYTHONPATH)\n")
-    sys.exit(-1)
-
-import mercurial.util
-import mercurial.dispatch
-
-for fp in (sys.stdin, sys.stdout, sys.stderr):
-    mercurial.util.setbinary(fp)
-
-mercurial.dispatch.run()
--- a/hgext/relink.py	Tue Jun 21 01:49:45 2011 +0400
+++ b/hgext/relink.py	Tue Jun 21 19:00:27 2011 -0300
@@ -117,7 +117,7 @@
         tgt = os.path.join(dst, fn)
         ts = linkfilter(srcpath, tgt, st)
         if not ts:
-            ui.debug(_('not linkable: %s\n') % fn)
+            ui.debug('not linkable: %s\n' % fn)
             continue
         targets.append((fn, ts.st_size))
         ui.progress(_('pruning'), pos, fn, _('files'), total)
@@ -159,7 +159,7 @@
         sfp.close()
         dfp.close()
         if sin:
-            ui.debug(_('not linkable: %s\n') % f)
+            ui.debug('not linkable: %s\n' % f)
             continue
         try:
             relinkfile(source, tgt)
--- a/mercurial/commands.py	Tue Jun 21 01:49:45 2011 +0400
+++ b/mercurial/commands.py	Tue Jun 21 19:00:27 2011 -0300
@@ -4552,7 +4552,7 @@
     """
 
     for f in scmutil.rcpath():
-        ui.debug(_('read config from: %s\n') % f)
+        ui.debug('read config from: %s\n' % f)
     untrusted = bool(opts.get('untrusted'))
     if values:
         sections = [v for v in values if '.' not in v]
--- a/mercurial/commandserver.py	Tue Jun 21 01:49:45 2011 +0400
+++ b/mercurial/commandserver.py	Tue Jun 21 19:00:27 2011 -0300
@@ -155,6 +155,9 @@
             raise util.Abort(_('unknown mode %s') % mode)
 
     def _read(self, size):
+        if not size:
+            return ''
+
         data = self.client.read(size)
 
         # is the other end closed?
@@ -168,7 +171,10 @@
         and writes the return code to the result channel """
 
         length = struct.unpack('>I', self._read(4))[0]
-        args = self._read(length).split('\0')
+        if not length:
+            args = []
+        else:
+            args = self._read(length).split('\0')
 
         # copy the ui so changes to it don't persist between requests
         req = dispatch.request(args, self.ui.copy(), self.repo, self.cin,
--- a/mercurial/config.py	Tue Jun 21 01:49:45 2011 +0400
+++ b/mercurial/config.py	Tue Jun 21 19:00:27 2011 -0300
@@ -27,6 +27,9 @@
     def update(self, src):
         for k in src:
             self[k] = src[k]
+    def clear(self):
+        dict.clear(self)
+        self._list = []
     def items(self):
         return [(k, self[k]) for k in self._list]
     def __delitem__(self, key):
--- a/mercurial/dispatch.py	Tue Jun 21 01:49:45 2011 +0400
+++ b/mercurial/dispatch.py	Tue Jun 21 19:00:27 2011 -0300
@@ -267,8 +267,8 @@
                     elif int(m.groups()[0]) <= len(args):
                         return m.group()
                     else:
-                        ui.debug(_("No argument found for substitution "
-                                   "of %i variable in alias '%s' definition.")
+                        ui.debug("No argument found for substitution "
+                                 "of %i variable in alias '%s' definition."
                                  % (int(m.groups()[0]), self.name))
                         return ''
                 cmd = re.sub(r'\$(\d+|\$)', _checkvar, self.definition[1:])
--- a/mercurial/fileset.py	Tue Jun 21 01:49:45 2011 +0400
+++ b/mercurial/fileset.py	Tue Jun 21 19:00:27 2011 -0300
@@ -228,7 +228,7 @@
     return [f for f in mctx.subset if f in ms and ms[f] == 'u']
 
 def hgignore(mctx, x):
-    """``resolved()``
+    """``hgignore()``
     File that matches the active .hgignore pattern.
     """
     getargs(x, 0, 0, _("hgignore takes no arguments"))
@@ -244,8 +244,7 @@
     return [f for f in mctx.subset if r.search(mctx.ctx[f].data())]
 
 _units = dict(k=2**10, K=2**10, kB=2**10, KB=2**10,
-              M=2**20, MB=2**20, G=2**30, GB=2**30,
-              kiB=10**3, MiB=10**6, GiB=10**9)
+              M=2**20, MB=2**20, G=2**30, GB=2**30)
 
 def _sizetoint(s):
     try:
@@ -280,9 +279,8 @@
     File size matches the given expression. Examples:
 
     - 1k (files from 1024 to 2047 bytes)
-    - 1.0kiB (files from 1000 to 1100 bytes)
     - < 20k (files less than 20480 bytes)
-    - >= .5MiB (files at least 500000 bytes)
+    - >= .5MB (files at least 524288 bytes)
     - 4k - 1MB (files from 4096 bytes to 1048576 bytes)
     """
 
@@ -307,7 +305,7 @@
     elif expr[0].isdigit or expr[0] == '.':
         a = _sizetoint(expr)
         b = _sizetomax(expr)
-        m = lambda x: x >=a and x <= b
+        m = lambda x: x >= a and x <= b
     else:
         raise error.ParseError(_("couldn't parse size"), expr)
 
@@ -404,7 +402,7 @@
 def getfileset(ctx, expr):
     tree, pos = parse(expr)
     if (pos != len(expr)):
-        raise error.ParseError("invalid token", pos)
+        raise error.ParseError(_("invalid token"), pos)
 
     # do we need status info?
     if _intree(['modified', 'added', 'removed', 'deleted',
--- a/mercurial/help/config.txt	Tue Jun 21 01:49:45 2011 +0400
+++ b/mercurial/help/config.txt	Tue Jun 21 19:00:27 2011 -0300
@@ -913,6 +913,11 @@
     file exists, it is replaced. Default: None, data is printed on
     stderr
 
+``revsetalias``
+"""""""""""""""
+
+Alias definitions for revsets. See :hg:`help revsets` for details.
+
 ``server``
 """"""""""
 
--- a/mercurial/help/revsets.txt	Tue Jun 21 01:49:45 2011 +0400
+++ b/mercurial/help/revsets.txt	Tue Jun 21 19:00:27 2011 -0300
@@ -42,7 +42,7 @@
 
 ``x - y``
   Changesets in x but not in y.
-  
+
 ``x^n``
   The nth parent of x, n == 0, 1, or 2.
   For n == 0, x; for n == 1, the first parent of each changeset in x;
@@ -66,8 +66,9 @@
 
   <alias> = <definition>
 
-in the ``revsetalias`` section of ``.hgrc``. Arguments of the form `$1`, `$2`,
-etc. are substituted from the alias into the definition.
+in the ``revsetalias`` section of a Mercurial configuration file. Arguments
+of the form `$1`, `$2`, etc. are substituted from the alias into the
+definition.
 
 For example,
 
--- a/mercurial/parser.py	Tue Jun 21 01:49:45 2011 +0400
+++ b/mercurial/parser.py	Tue Jun 21 19:00:27 2011 -0300
@@ -16,6 +16,7 @@
 # __call__(program) parses program into a labelled tree
 
 import error
+from i18n import _
 
 class parser(object):
     def __init__(self, tokenizer, elements, methods=None):
@@ -34,7 +35,7 @@
     def _match(self, m, pos):
         'make sure the tokenizer matches an end condition'
         if self.current[0] != m:
-            raise error.ParseError("unexpected token: %s" % self.current[0],
+            raise error.ParseError(_("unexpected token: %s") % self.current[0],
                                    self.current[2])
         self._advance()
     def _parse(self, bind=0):
@@ -42,7 +43,7 @@
         # handle prefix rules on current token
         prefix = self._elements[token][1]
         if not prefix:
-            raise error.ParseError("not a prefix: %s" % token, pos)
+            raise error.ParseError(_("not a prefix: %s") % token, pos)
         if len(prefix) == 1:
             expr = (prefix[0], value)
         else:
@@ -64,7 +65,7 @@
             else:
                 # handle infix rules
                 if len(e) < 3 or not e[2]:
-                    raise error.ParseError("not an infix: %s" % token, pos)
+                    raise error.ParseError(_("not an infix: %s") % token, pos)
                 infix = e[2]
                 if len(infix) == 3 and infix[2] == self.current[0]:
                     self._match(infix[2], pos)
--- a/mercurial/patch.py	Tue Jun 21 01:49:45 2011 +0400
+++ b/mercurial/patch.py	Tue Jun 21 19:00:27 2011 -0300
@@ -1378,7 +1378,7 @@
             cwd = repo.getcwd()
             if cwd:
                 cfiles = [util.pathto(repo.root, cwd, f)
-                          for f in cfile]
+                          for f in cfiles]
             scmutil.addremove(repo, cfiles, similarity=similarity)
     code = fp.close()
     if code:
--- a/mercurial/revset.py	Tue Jun 21 01:49:45 2011 +0400
+++ b/mercurial/revset.py	Tue Jun 21 19:00:27 2011 -0300
@@ -979,7 +979,7 @@
                 value = value.replace(arg, repr(arg))
             self.replacement, pos = parse(value)
             if pos != len(value):
-                raise error.ParseError('invalid token', pos)
+                raise error.ParseError(_('invalid token'), pos)
         else:
             self.replacement = value
 
@@ -997,7 +997,8 @@
             (len(self.args) == 1 and tree[2][0] == 'list') or
             (len(self.args) > 1 and (tree[2][0] != 'list' or
                                      len(tree[2]) - 1 != len(self.args)))):
-            raise error.ParseError('invalid amount of arguments', len(tree) - 2)
+            raise error.ParseError(_('invalid amount of arguments'),
+                                   len(tree) - 2)
         return True
 
     def replace(self, tree):
@@ -1033,7 +1034,7 @@
         raise error.ParseError(_("empty query"))
     tree, pos = parse(spec)
     if (pos != len(spec)):
-        raise error.ParseError("invalid token", pos)
+        raise error.ParseError(_("invalid token"), pos)
     tree = findaliases(ui, tree)
     weight, tree = optimize(tree, True)
     def mfunc(repo, subset):
--- a/mercurial/treediscovery.py	Tue Jun 21 01:49:45 2011 +0400
+++ b/mercurial/treediscovery.py	Tue Jun 21 19:00:27 2011 -0300
@@ -49,7 +49,6 @@
     if not unknown:
         return list(base), [], list(heads)
 
-    heads = unknown
     req = set(unknown)
     reqcnt = 0
 
--- a/mercurial/ui.py	Tue Jun 21 01:49:45 2011 +0400
+++ b/mercurial/ui.py	Tue Jun 21 19:00:27 2011 -0300
@@ -159,8 +159,8 @@
         if self.debugflag and not untrusted and self._reportuntrusted:
             uvalue = self._ucfg.get(section, name)
             if uvalue is not None and uvalue != value:
-                self.debug(_("ignoring untrusted configuration option "
-                             "%s.%s = %s\n") % (section, name, uvalue))
+                self.debug("ignoring untrusted configuration option "
+                           "%s.%s = %s\n" % (section, name, uvalue))
         return value
 
     def configpath(self, section, name, default=None, untrusted=False):
@@ -330,8 +330,8 @@
         if self.debugflag and not untrusted and self._reportuntrusted:
             for k, v in self._ucfg.items(section):
                 if self._tcfg.get(section, k) != v:
-                    self.debug(_("ignoring untrusted configuration option "
-                                "%s.%s = %s\n") % (section, k, v))
+                    self.debug("ignoring untrusted configuration option "
+                               "%s.%s = %s\n" % (section, k, v))
         return items
 
     def walkconfig(self, untrusted=False):
--- a/mercurial/util.py	Tue Jun 21 01:49:45 2011 +0400
+++ b/mercurial/util.py	Tue Jun 21 19:00:27 2011 -0300
@@ -1359,6 +1359,8 @@
     <url scheme: 'bundle', path: '../foo'>
     >>> url(r'c:\foo\bar')
     <url path: 'c:\\foo\\bar'>
+    >>> url(r'\\blah\blah\blah')
+    <url path: '\\\\blah\\blah\\blah'>
 
     Authentication credentials:
 
@@ -1387,8 +1389,8 @@
         self._hostport = ''
         self._origpath = path
 
-        # special case for Windows drive letters
-        if hasdriveletter(path):
+        # special case for Windows drive letters and UNC paths
+        if hasdriveletter(path) or path.startswith(r'\\'):
             self.path = path
             return
 
--- a/tests/test-treediscovery.t	Tue Jun 21 01:49:45 2011 +0400
+++ b/tests/test-treediscovery.t	Tue Jun 21 19:00:27 2011 -0300
@@ -319,5 +319,180 @@
   11 a19bfa7e7328: r11 both
   $ cd ..
 
+Both have new stuff in new named branches:
+
+  $ stop
+  $ hg clone main repo1a --rev name1 -q
+  $ hg clone repo1a repo1b -q
+  $ hg clone main repo2a --rev name2 -q
+  $ hg clone repo2a repo2b -q
+  $ start repo1a
+
+  $ cd repo2a
+  $ hg incoming $remote
+  comparing with http://localhost:$HGPORT/
+  searching for changes
+  6 a7892891da29: r2 name1
+  7 2c8d5d5ec612: r3 name1
+  8 e71dbbc70e03: r4 name1
+  $ hg outgoing $remote
+  comparing with http://localhost:$HGPORT/
+  searching for changes
+  2 70314b29987d: r5 name2
+  3 6c6f5d5f3c11: r6 name2
+  4 b6b4d315a2ac: r7 name2
+  5 d8f638ac69e9: r8 name2
+  $ hg push $remote --new-branch
+  pushing to http://localhost:$HGPORT/
+  searching for changes
+  remote: adding changesets
+  remote: adding manifests
+  remote: adding file changes
+  remote: added 4 changesets with 8 changes to 2 files (+1 heads)
+  $ hg pull $remote
+  pulling from http://localhost:$HGPORT/
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 3 changesets with 6 changes to 2 files (+1 heads)
+  (run 'hg heads' to see heads)
+  $ hg incoming $remote
+  comparing with http://localhost:$HGPORT/
+  searching for changes
+  no changes found
+  [1]
+  $ hg outgoing $remote
+  comparing with http://localhost:$HGPORT/
+  searching for changes
+  no changes found
+  [1]
+  $ cd ..
+
+  $ stop ; start repo1b
+  $ cd repo2b
+  $ hg incoming $remote
+  comparing with http://localhost:$HGPORT/
+  searching for changes
+  6 a7892891da29: r2 name1
+  7 2c8d5d5ec612: r3 name1
+  8 e71dbbc70e03: r4 name1
+  $ hg outgoing $remote
+  comparing with http://localhost:$HGPORT/
+  searching for changes
+  2 70314b29987d: r5 name2
+  3 6c6f5d5f3c11: r6 name2
+  4 b6b4d315a2ac: r7 name2
+  5 d8f638ac69e9: r8 name2
+  $ hg pull $remote
+  pulling from http://localhost:$HGPORT/
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 3 changesets with 6 changes to 2 files (+1 heads)
+  (run 'hg heads' to see heads)
+  $ hg push $remote --new-branch
+  pushing to http://localhost:$HGPORT/
+  searching for changes
+  remote: adding changesets
+  remote: adding manifests
+  remote: adding file changes
+  remote: added 4 changesets with 8 changes to 2 files (+1 heads)
+  $ hg incoming $remote
+  comparing with http://localhost:$HGPORT/
+  searching for changes
+  no changes found
+  [1]
+  $ hg outgoing $remote
+  comparing with http://localhost:$HGPORT/
+  searching for changes
+  no changes found
+  [1]
+  $ cd ..
+
+Both have new stuff in existing named branches:
+
+  $ stop
+  $ rm -r repo1a repo1b repo2a repo2b
+  $ hg clone main repo1a --rev 3 --rev 8 -q
+  $ hg clone repo1a repo1b -q
+  $ hg clone main repo2a --rev 4 --rev 7 -q
+  $ hg clone repo2a repo2b -q
+  $ start repo1a
+
+  $ cd repo2a
+  $ hg incoming $remote
+  comparing with http://localhost:$HGPORT/
+  searching for changes
+  8 d8f638ac69e9: r8 name2
+  $ hg outgoing $remote
+  comparing with http://localhost:$HGPORT/
+  searching for changes
+  4 e71dbbc70e03: r4 name1
+  $ hg push $remote --new-branch
+  pushing to http://localhost:$HGPORT/
+  searching for changes
+  remote: adding changesets
+  remote: adding manifests
+  remote: adding file changes
+  remote: added 1 changesets with 2 changes to 2 files
+  $ hg pull $remote
+  pulling from http://localhost:$HGPORT/
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 2 changes to 2 files
+  (run 'hg update' to get a working copy)
+  $ hg incoming $remote
+  comparing with http://localhost:$HGPORT/
+  searching for changes
+  no changes found
+  [1]
+  $ hg outgoing $remote
+  comparing with http://localhost:$HGPORT/
+  searching for changes
+  no changes found
+  [1]
+  $ cd ..
+
+  $ stop ; start repo1b
+  $ cd repo2b
+  $ hg incoming $remote
+  comparing with http://localhost:$HGPORT/
+  searching for changes
+  8 d8f638ac69e9: r8 name2
+  $ hg outgoing $remote
+  comparing with http://localhost:$HGPORT/
+  searching for changes
+  4 e71dbbc70e03: r4 name1
+  $ hg pull $remote
+  pulling from http://localhost:$HGPORT/
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 2 changes to 2 files
+  (run 'hg update' to get a working copy)
+  $ hg push $remote --new-branch
+  pushing to http://localhost:$HGPORT/
+  searching for changes
+  remote: adding changesets
+  remote: adding manifests
+  remote: adding file changes
+  remote: added 1 changesets with 2 changes to 2 files
+  $ hg incoming $remote
+  comparing with http://localhost:$HGPORT/
+  searching for changes
+  no changes found
+  [1]
+  $ hg outgoing $remote
+  comparing with http://localhost:$HGPORT/
+  searching for changes
+  no changes found
+  [1]
+  $ cd ..
+
   $ stop