changeset 21963:315cb6f5156a stable

merge with i18n
author Matt Mackall <mpm@selenic.com>
date Thu, 31 Jul 2014 14:42:14 -0500
parents af15de6775c7 (diff) 8ea921bf1c47 (current diff)
children ef555e456420
files
diffstat 8 files changed, 50 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/convert/git.py	Fri Aug 01 01:13:53 2014 +0900
+++ b/hgext/convert/git.py	Thu Jul 31 14:42:14 2014 -0500
@@ -127,7 +127,8 @@
         size = int(info[2])
         data = self.catfilepipe[1].read(size)
         if len(data) < size:
-            raise util.Abort(_('cannot read %r object at %s: %s') % (type, rev))
+            raise util.Abort(_('cannot read %r object at %s: unexpected size')
+                             % (type, rev))
         # read the trailing newline
         self.catfilepipe[1].read(1)
         return data
--- a/mercurial/commands.py	Fri Aug 01 01:13:53 2014 +0900
+++ b/mercurial/commands.py	Thu Jul 31 14:42:14 2014 -0500
@@ -8,7 +8,7 @@
 from node import hex, bin, nullid, nullrev, short
 from lock import release
 from i18n import _
-import os, re, difflib, time, tempfile, errno
+import os, re, difflib, time, tempfile, errno, shlex
 import sys
 import hg, scmutil, util, revlog, copies, error, bookmarks
 import patch, help, encoding, templatekw, discovery
@@ -2247,7 +2247,7 @@
     # editor
     ui.status(_("checking commit editor...\n"))
     editor = ui.geteditor()
-    cmdpath = util.findexe(editor) or util.findexe(editor.split()[0])
+    cmdpath = util.findexe(shlex.split(editor)[0])
     if not cmdpath:
         if editor == 'vi':
             ui.write(_(" No commit editor set and can't find vi in PATH\n"))
@@ -3882,8 +3882,8 @@
                         parents = [repo[node]]
                     if rej:
                         ui.write_err(_("patch applied partially\n"))
-                        ui.write_err(("(fix the .rej files and run "
-                                      "`hg commit --amend`)\n"))
+                        ui.write_err(_("(fix the .rej files and run "
+                                       "`hg commit --amend`)\n"))
                         ret = 1
                         break
 
--- a/mercurial/dispatch.py	Fri Aug 01 01:13:53 2014 +0900
+++ b/mercurial/dispatch.py	Thu Jul 31 14:42:14 2014 -0500
@@ -766,7 +766,7 @@
     if options['version']:
         return commands.version_(ui)
     if options['help']:
-        return commands.help_(ui, cmd)
+        return commands.help_(ui, cmd, command=True)
     elif not cmd:
         return commands.help_(ui, 'shortlist')
 
--- a/mercurial/templater.py	Fri Aug 01 01:13:53 2014 +0900
+++ b/mercurial/templater.py	Thu Jul 31 14:42:14 2014 -0500
@@ -468,6 +468,7 @@
 
 def startswith(context, mapping, args):
     if len(args) != 2:
+        # i18n: "startswith" is a keyword
         raise error.ParseError(_("startswith expects two arguments"))
 
     patn = stringify(args[0][0](context, mapping, args[0][1]))
@@ -480,6 +481,7 @@
 def word(context, mapping, args):
     """return nth word from a string"""
     if not (2 <= len(args) <= 3):
+        # i18n: "word" is a keyword
         raise error.ParseError(_("word expects two or three arguments, got %d")
                                % len(args))
 
--- a/mercurial/ui.py	Fri Aug 01 01:13:53 2014 +0900
+++ b/mercurial/ui.py	Thu Jul 31 14:42:14 2014 -0500
@@ -437,7 +437,7 @@
         """
         user = os.environ.get("HGUSER")
         if user is None:
-            user = self.config("ui", "username")
+            user = self.config("ui", ["username", "user"])
             if user is not None:
                 user = os.path.expandvars(user)
         if user is None:
--- a/tests/test-bundle2.t	Fri Aug 01 01:13:53 2014 +0900
+++ b/tests/test-bundle2.t	Thu Jul 31 14:42:14 2014 -0500
@@ -8,6 +8,15 @@
   > code. We still need to be able to test it while it grow up.
   > """
   > 
+  > import sys
+  > from mercurial import cmdutil
+  > from mercurial import util
+  > from mercurial import bundle2
+  > from mercurial import scmutil
+  > from mercurial import discovery
+  > from mercurial import changegroup
+  > from mercurial import error
+  > 
   > try:
   >     import msvcrt
   >     msvcrt.setmode(sys.stdin.fileno(), os.O_BINARY)
@@ -16,14 +25,6 @@
   > except ImportError:
   >     pass
   > 
-  > import sys
-  > from mercurial import cmdutil
-  > from mercurial import util
-  > from mercurial import bundle2
-  > from mercurial import scmutil
-  > from mercurial import discovery
-  > from mercurial import changegroup
-  > from mercurial import error
   > cmdtable = {}
   > command = cmdutil.command(cmdtable)
   > 
--- a/tests/test-committer.t	Fri Aug 01 01:13:53 2014 +0900
+++ b/tests/test-committer.t	Thu Jul 31 14:42:14 2014 -0500
@@ -52,15 +52,34 @@
   abort: no username supplied
   (use "hg config --edit" to set your username)
   [255]
+
+# test alternate config var
+
+  $ echo 1234 > asdf
+  $ echo "[ui]" > .hg/hgrc
+  $ echo "user = Foo Bar II <foo2@bar.com>" >> .hg/hgrc
+  $ hg commit -m commit-1
+  $ hg tip
+  changeset:   4:6f24bfb4c617
+  tag:         tip
+  user:        Foo Bar II <foo2@bar.com>
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     commit-1
+  
+# test no .hg/hgrc (uses generated non-interactive username)
+
+  $ echo space > asdf
   $ rm .hg/hgrc
   $ hg commit -m commit-1 2>&1
   no username found, using '[^']*' instead (re)
 
-  $ echo space > asdf
+  $ echo space2 > asdf
   $ hg commit -u ' ' -m commit-1
   transaction abort!
   rollback completed
   abort: empty username!
   [255]
 
+# don't add tests here, previous test is unstable
+
   $ cd ..
--- a/tests/test-help.t	Fri Aug 01 01:13:53 2014 +0900
+++ b/tests/test-help.t	Thu Jul 31 14:42:14 2014 -0500
@@ -862,6 +862,17 @@
   *"hg -v help debugoptDEP"* (glob)
 #endif
 
+Test commands that collide with topics (issue4240)
+
+  $ hg config -hq
+  hg config [-u] [NAME]...
+  
+  show combined config settings from all hgrc files
+  $ hg showconfig -hq
+  hg config [-u] [NAME]...
+  
+  show combined config settings from all hgrc files
+
 Test a help topic
 
   $ hg help revs