changeset 11246:8f5ad12db28e stable

Merge with i18n
author Matt Mackall <mpm@selenic.com>
date Mon, 31 May 2010 12:57:24 -0500
parents ccb4057e19e6 (diff) cff6dfe28f02 (current diff)
children 102d8eb5c890 0bb67503ad4b
files
diffstat 8 files changed, 125 insertions(+), 41 deletions(-) [+]
line wrap: on
line diff
--- a/doc/hgrc.5.txt	Tue May 25 13:20:33 2010 -0300
+++ b/doc/hgrc.5.txt	Mon May 31 12:57:24 2010 -0500
@@ -90,7 +90,8 @@
 ------
 
 A configuration file consists of sections, led by a ``[section]`` header
-and followed by ``name = value`` entries::
+and followed by ``name = value`` entries (sometimes called
+``configuration keys``)::
 
     [spam]
     eggs=ham
@@ -102,6 +103,45 @@
 removed from values. Empty lines are skipped. Lines beginning with
 ``#`` or ``;`` are ignored and may be used to provide comments.
 
+Configuration keys can be set multiple times, in which case mercurial
+will use the value that was configured last. As an example::
+
+    [spam]
+    eggs=large
+    ham=serrano
+    eggs=small
+
+This would set the configuration key named ``eggs`` to ``small``.
+
+It is also possible to define a section multiple times. A section can
+be redefined on the same and/or on different hgrc files. For example::
+
+    [foo]
+    eggs=large
+    ham=serrano
+    eggs=small
+
+    [bar]
+    eggs=ham
+    green=
+       eggs
+
+    [foo]
+    ham=prosciutto
+    eggs=medium
+    bread=toasted
+
+This would set the ``eggs``, ``ham``, and ``bread`` configuration keys
+of the ``foo`` section to ``medium``, ``prosciutto``, and ``toasted``,
+respectively. As you can see there only thing that matters is the last
+value that was set for each of the configuration keys.
+
+If a configuration key is set multiple times in different
+configuration files the final value will depend on the order in which
+the different configuration files are read, with settings from earlier
+paths overriding later ones as described on the ``Files`` section
+above.
+
 A line of the form ``%include file`` will include ``file`` into the
 current configuration file. The inclusion is recursive, which means
 that included files can include other files. Filenames are relative to
--- a/hgext/pager.py	Tue May 25 13:20:33 2010 -0300
+++ b/hgext/pager.py	Mon May 31 12:57:24 2010 -0500
@@ -49,7 +49,7 @@
 specify them in the global .hgrc
 '''
 
-import sys, os, signal, shlex
+import sys, os, signal, shlex, errno
 from mercurial import dispatch, util, extensions
 
 def _runpager(p):
@@ -67,8 +67,15 @@
     os.dup2(fdin, sys.stdin.fileno())
     os.close(fdin)
     os.close(fdout)
-    args = shlex.split(p)
-    os.execvp(args[0], args)
+    try:
+        os.execvp('/bin/sh', ['/bin/sh', '-c', p])
+    except OSError, e:
+        if e.errno == errno.ENOENT:
+            # no /bin/sh, try executing the pager directly
+            args = shlex.split(p)
+            os.execvp(args[0], args)
+        else:
+            raise
 
 def uisetup(ui):
     def pagecmd(orig, ui, options, cmd, cmdfunc):
--- a/hgext/record.py	Tue May 25 13:20:33 2010 -0300
+++ b/hgext/record.py	Mon May 31 12:57:24 2010 -0500
@@ -295,9 +295,9 @@
             r = ui.promptchoice("%s %s" % (query, resps), choices)
             if r == 7: # ?
                 doc = gettext(record.__doc__)
-                c = doc.find(_('y - record this change'))
+                c = doc.find('::') + 2
                 for l in doc[c:].splitlines():
-                    if l:
+                    if l.startswith('      '):
                         ui.write(l.strip(), '\n')
                 continue
             elif r == 0: # yes
@@ -379,7 +379,9 @@
       a - record all changes to all remaining files
       q - quit, recording no changes
 
-      ? - display help'''
+      ? - display help
+
+    This command is not available when committing a merge.'''
 
     dorecord(ui, repo, commands.commit, *pats, **opts)
 
@@ -418,10 +420,15 @@
         After the actual job is done by non-interactive command, working dir
         state is restored to original.
 
-        In the end we'll record intresting changes, and everything else will be
+        In the end we'll record interesting changes, and everything else will be
         left in place, so the user can continue his work.
         """
 
+        merge = len(repo[None].parents()) > 1
+        if merge:
+            raise util.Abort(_('cannot partially commit a merge '
+                               '(use hg commit instead)'))
+
         changes = repo.status(match=match)[:3]
         diffopts = mdiff.diffopts(git=True, nodates=True)
         chunks = patch.diff(repo, changes=changes, opts=diffopts)
--- a/mercurial/commands.py	Tue May 25 13:20:33 2010 -0300
+++ b/mercurial/commands.py	Mon May 31 12:57:24 2010 -0500
@@ -2424,19 +2424,22 @@
 def push(ui, repo, dest=None, **opts):
     """push changes to the specified destination
 
-    Push changes from the local repository to the specified destination.
-
-    This is the symmetrical operation for pull. It moves changes from
-    the current repository to a different one. If the destination is
-    local this is identical to a pull in that directory from the
-    current one.
-
-    By default, push will refuse to run if it detects the result would
-    increase the number of remote heads. This generally indicates the
-    user forgot to pull and merge before pushing.
-
-    If -r/--rev is used, the named revision and all its ancestors will
-    be pushed to the remote repository.
+    Push changesets from the local repository to the specified
+    destination.
+
+    This operation is symmetrical to pull: it is identical to a pull
+    in the destination repository from the current one.
+
+    By default, push will not allow creation of new heads at the
+    destination, since multiple heads would make it unclear which head
+    to use. In this situation, it is recommended to pull and merge
+    before pushing.
+
+    Use -f/--force to override the default behavior and push all
+    changesets on all branches.
+
+    If -r/--rev is used, the specified revision and all its ancestors
+    will be pushed to the remote repository.
 
     Please see 'hg help urls' for important details about ``ssh://``
     URLs. If DESTINATION is omitted, a default path will be used.
--- a/mercurial/hgweb/hgwebdir_mod.py	Tue May 25 13:20:33 2010 -0300
+++ b/mercurial/hgweb/hgwebdir_mod.py	Mon May 31 12:57:24 2010 -0500
@@ -56,21 +56,33 @@
             return
 
         if self.baseui:
-            self.ui = self.baseui.copy()
+            u = self.baseui.copy()
         else:
-            self.ui = ui.ui()
-            self.ui.setconfig('ui', 'report_untrusted', 'off')
-            self.ui.setconfig('ui', 'interactive', 'off')
+            u = ui.ui()
+            u.setconfig('ui', 'report_untrusted', 'off')
+            u.setconfig('ui', 'interactive', 'off')
 
         if not isinstance(self.conf, (dict, list, tuple)):
             map = {'paths': 'hgweb-paths'}
-            self.ui.readconfig(self.conf, remap=map, trust=True)
-            paths = self.ui.configitems('hgweb-paths')
+            u.readconfig(self.conf, remap=map, trust=True)
+            paths = u.configitems('hgweb-paths')
         elif isinstance(self.conf, (list, tuple)):
             paths = self.conf
         elif isinstance(self.conf, dict):
             paths = self.conf.items()
 
+        repos = findrepos(paths)
+        for prefix, root in u.configitems('collections'):
+            prefix = util.pconvert(prefix)
+            for path in util.walkrepos(root, followsym=True):
+                repo = os.path.normpath(path)
+                name = util.pconvert(repo)
+                if name.startswith(prefix):
+                    name = name[len(prefix):]
+                repos.append((name.lstrip('/'), repo))
+
+        self.repos = repos
+        self.ui = u
         encoding.encoding = self.ui.config('web', 'encoding',
                                            encoding.encoding)
         self.style = self.ui.config('web', 'style', 'paper')
@@ -78,17 +90,6 @@
         if self.stripecount:
             self.stripecount = int(self.stripecount)
         self._baseurl = self.ui.config('web', 'baseurl')
-
-        self.repos = findrepos(paths)
-        for prefix, root in self.ui.configitems('collections'):
-            prefix = util.pconvert(prefix)
-            for path in util.walkrepos(root, followsym=True):
-                repo = os.path.normpath(path)
-                name = util.pconvert(repo)
-                if name.startswith(prefix):
-                    name = name[len(prefix):]
-                self.repos.append((name.lstrip('/'), repo))
-
         self.lastrefresh = time.time()
 
     def run(self):
--- a/mercurial/localrepo.py	Tue May 25 13:20:33 2010 -0300
+++ b/mercurial/localrepo.py	Mon May 31 12:57:24 2010 -0500
@@ -1010,7 +1010,9 @@
             match.bad = bad
 
         if working: # we need to scan the working dir
-            subrepos = ctx1.substate.keys()
+            subrepos = []
+            if '.hgsub' in self.dirstate:
+                subrepos = ctx1.substate.keys()
             s = self.dirstate.status(match, subrepos, listignored,
                                      listclean, listunknown)
             cmp, modified, added, removed, deleted, unknown, ignored, clean = s
--- a/tests/test-record	Tue May 25 13:20:33 2010 -0300
+++ b/tests/test-record	Mon May 31 12:57:24 2010 -0500
@@ -297,9 +297,20 @@
 EOF
 echo; hg tip --config diff.git=True -p
 
+cd ..
+
+echo % abort early when a merge is in progress
+hg up 4
+touch iwillmergethat
+hg add iwillmergethat
+hg branch thatbranch
+hg ci -m'new head'
+hg up default
+hg merge thatbranch
+echo; hg record -m'will abort'
+hg up -C
 
 echo % with win32ext
-cd ..
 echo '[extensions]' >> .hg/hgrc
 echo 'win32text = ' >> .hg/hgrc
 echo '[decode]' >> .hg/hgrc
--- a/tests/test-record.out	Tue May 25 13:20:33 2010 -0300
+++ b/tests/test-record.out	Mon May 31 12:57:24 2010 -0500
@@ -24,6 +24,8 @@
 
       ? - display help
 
+    This command is not available when committing a merge.
+
 options:
 
  -A --addremove     mark new/missing files as added/removed before committing
@@ -569,6 +571,16 @@
  b
 +c
 
+% abort early when a merge is in progress
+1 files updated, 0 files merged, 5 files removed, 0 files unresolved
+marked working directory as branch thatbranch
+created new head
+5 files updated, 0 files merged, 2 files removed, 0 files unresolved
+1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+(branch merge, don't forget to commit)
+
+abort: cannot partially commit a merge (use hg commit instead)
+0 files updated, 0 files merged, 1 files removed, 0 files unresolved
 % with win32ext
 diff --git a/subdir/f1 b/subdir/f1
 1 hunks, 1 lines changed
@@ -578,8 +590,9 @@
  c
 +d
 record this change to 'subdir/f1'? [Ynsfdaq?] 
-changeset:   25:5bacc1f6e9cf
+changeset:   26:5bacc1f6e9cf
 tag:         tip
+parent:      24:1460f6e47966
 user:        test
 date:        Thu Jan 01 00:00:23 1970 +0000
 summary:     w1