changeset 14109:3cb1e95676ad stable 1.8.3

merge with i18n
author Matt Mackall <mpm@selenic.com>
date Sun, 01 May 2011 05:53:28 -0500
parents 243e4f5176c3 (current diff) 23fc62e0a960 (diff)
children fdb1a5b3a18c
files
diffstat 10 files changed, 126 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/extdiff.py	Fri Apr 29 18:19:08 2011 -0300
+++ b/hgext/extdiff.py	Sun May 01 05:53:28 2011 -0500
@@ -100,7 +100,8 @@
             if 'x' in fctx.flags():
                 util.set_flags(dest, False, True)
         if node is None:
-            fns_and_mtime.append((dest, repo.wjoin(fn), os.path.getmtime(dest)))
+            fns_and_mtime.append((dest, repo.wjoin(fn),
+                                  os.lstat(dest).st_mtime))
     return dirname, fns_and_mtime
 
 def dodiff(ui, repo, diffcmd, diffopts, pats, opts):
@@ -222,7 +223,7 @@
         util.system(cmdline, cwd=tmproot)
 
         for copy_fn, working_fn, mtime in fns_and_mtime:
-            if os.path.getmtime(copy_fn) != mtime:
+            if os.lstat(copy_fn).st_mtime != mtime:
                 ui.debug('file changed while diffing. '
                          'Overwriting: %s (src: %s)\n' % (working_fn, copy_fn))
                 util.copyfile(copy_fn, working_fn)
--- a/hgext/mq.py	Fri Apr 29 18:19:08 2011 -0300
+++ b/hgext/mq.py	Sun May 01 05:53:28 2011 -0500
@@ -834,7 +834,7 @@
                 raise util.Abort(_("local changes found"))
         return m, a, r, d
 
-    _reserved = ('series', 'status', 'guards')
+    _reserved = ('series', 'status', 'guards', '.', '..')
     def check_reserved_name(self, name):
         if (name in self._reserved or name.startswith('.hg')
             or name.startswith('.mq') or '#' in name or ':' in name):
--- a/hgext/zeroconf/__init__.py	Fri Apr 29 18:19:08 2011 -0300
+++ b/hgext/zeroconf/__init__.py	Sun May 01 05:53:28 2011 -0500
@@ -27,7 +27,7 @@
 import socket, time, os
 
 import Zeroconf
-from mercurial import ui, hg, encoding, util
+from mercurial import ui, hg, encoding, util, dispatch
 from mercurial import extensions
 from mercurial.hgweb import hgweb_mod
 from mercurial.hgweb import hgwebdir_mod
@@ -166,6 +166,18 @@
             return name.encode(encoding.encoding)
     return orig(source)
 
+def cleanupafterdispatch(orig, ui, options, cmd, cmdfunc):
+    try:
+        return orig(ui, options, cmd, cmdfunc)
+    finally:
+        # we need to call close() on the server to notify() the various
+        # threading Conditions and allow the background threads to exit
+        global server
+        if server:
+            server.close()
+
+extensions.wrapfunction(dispatch, '_runcommand', cleanupafterdispatch)
+
 extensions.wrapfunction(ui.ui, 'config', config)
 extensions.wrapfunction(ui.ui, 'configitems', configitems)
 extensions.wrapfunction(hg, 'defaultdest', defaultdest)
--- a/mercurial/subrepo.py	Fri Apr 29 18:19:08 2011 -0300
+++ b/mercurial/subrepo.py	Sun May 01 05:53:28 2011 -0500
@@ -10,6 +10,7 @@
 from i18n import _
 import config, util, node, error, cmdutil
 hg = None
+propertycache = util.propertycache
 
 nullstate = ('', '', 'empty')
 
@@ -521,8 +522,18 @@
         self._ui = ctx._repo.ui
 
     def _svncommand(self, commands, filename=''):
-        path = os.path.join(self._ctx._repo.origroot, self._path, filename)
-        cmd = ['svn'] + commands + [path]
+        cmd = ['svn']
+        # Starting in svn 1.5 --non-interactive is a global flag
+        # instead of being per-command, but we need to support 1.4 so
+        # we have to be intelligent about what commands take
+        # --non-interactive.
+        if (not self._ui.interactive() and
+            commands[0] in ('update', 'checkout', 'commit')):
+            cmd.append('--non-interactive')
+        cmd.extend(commands)
+        if filename is not None:
+            path = os.path.join(self._ctx._repo.origroot, self._path, filename)
+            cmd.append(path)
         env = dict(os.environ)
         # Avoid localized output, preserve current locale for everything else.
         env['LC_MESSAGES'] = 'C'
@@ -535,6 +546,14 @@
             raise util.Abort(stderr)
         return stdout
 
+    @propertycache
+    def _svnversion(self):
+        output = self._svncommand(['--version'], filename=None)
+        m = re.search(r'^svn,\s+version\s+(\d+)\.(\d+)', output)
+        if not m:
+            raise util.Abort(_('cannot retrieve svn tool version'))
+        return (int(m.group(1)), int(m.group(2)))
+
     def _wcrevs(self):
         # Get the working directory revision as well as the last
         # commit revision so we can compare the subrepo state with
@@ -629,7 +648,11 @@
     def get(self, state, overwrite=False):
         if overwrite:
             self._svncommand(['revert', '--recursive'])
-        status = self._svncommand(['checkout', state[0], '--revision', state[1]])
+        args = ['checkout']
+        if self._svnversion >= (1, 5):
+            args.append('--force')
+        args.extend([state[0], '--revision', state[1]])
+        status = self._svncommand(args)
         if not re.search('Checked out revision [0-9]+.', status):
             raise util.Abort(status.splitlines()[-1])
         self._ui.status(status)
--- a/tests/hghave	Fri Apr 29 18:19:08 2011 -0300
+++ b/tests/hghave	Sun May 01 05:53:28 2011 -0500
@@ -121,6 +121,15 @@
     except ImportError:
         return False
 
+def getsvnversion():
+    m = matchoutput('svn --version 2>&1', r'^svn,\s+version\s+(\d+)\.(\d+)')
+    if not m:
+        return (0, 0)
+    return (int(m.group(1)), int(m.group(2)))
+
+def has_svn15():
+    return getsvnversion() >= (1, 5)
+
 def has_svn():
     return matchoutput('svn --version 2>&1', r'^svn, version') and \
         matchoutput('svnadmin --version 2>&1', r'^svnadmin, version')
@@ -204,6 +213,7 @@
     "pygments": (has_pygments, "Pygments source highlighting library"),
     "ssl": (has_ssl, "python >= 2.6 ssl module and python OpenSSL"),
     "svn": (has_svn, "subversion client and admin tools"),
+    "svn15": (has_svn15, "subversion client and admin tools >= 1.5"),
     "svn-bindings": (has_svn_bindings, "subversion python bindings"),
     "symlink": (has_symlink, "symbolic links"),
     "tla": (has_tla, "GNU Arch tla client"),
--- a/tests/test-extdiff.t	Fri Apr 29 18:19:08 2011 -0300
+++ b/tests/test-extdiff.t	Sun May 01 05:53:28 2011 -0500
@@ -167,4 +167,18 @@
   $ hg falabala -o this -c 1
   diffing this a.8a5febb7f867/a a.34eed99112ab/a
   [1]
+  $ cd ..
 
+  $ hg init testsymlinks
+  $ cd testsymlinks
+  $ echo a > a
+  $ hg ci -Am adda
+  adding a
+  $ echo a >> a
+  $ ln -s missing linka
+  $ hg add linka
+  $ hg falabala -r 0 --traceback
+  diffing testsymlinks.07f494440405 testsymlinks
+  [1]
+  $ cd ..
+
--- a/tests/test-http-proxy.t	Fri Apr 29 18:19:08 2011 -0300
+++ b/tests/test-http-proxy.t	Sun May 01 05:53:28 2011 -0500
@@ -17,7 +17,7 @@
   $ http_proxy=http://localhost:$HGPORT1/ hg --config http_proxy.always=True clone --uncompressed http://localhost:$HGPORT/ b
   streaming all changes
   3 files to transfer, 303 bytes of data
-  transferred * bytes in * seconds (*B/sec) (glob)
+  transferred * bytes in * seconds (*/sec) (glob)
   updating to branch default
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ cd b
--- a/tests/test-http.t	Fri Apr 29 18:19:08 2011 -0300
+++ b/tests/test-http.t	Sun May 01 05:53:28 2011 -0500
@@ -27,7 +27,7 @@
   $ hg clone --uncompressed http://localhost:$HGPORT/ copy 2>&1
   streaming all changes
   6 files to transfer, 606 bytes of data
-  transferred * bytes in * seconds (*B/sec) (glob)
+  transferred * bytes in * seconds (*/sec) (glob)
   updating to branch default
   4 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg verify -R copy
--- a/tests/test-mq-qnew.t	Fri Apr 29 18:19:08 2011 -0300
+++ b/tests/test-mq-qnew.t	Sun May 01 05:53:28 2011 -0500
@@ -15,6 +15,8 @@
   >     hg qnew series
   >     hg qnew status
   >     hg qnew guards
+  >     hg qnew .
+  >     hg qnew ..
   >     hg qnew .hgignore
   >     hg qnew .mqfoo
   >     hg qnew 'foo#bar'
@@ -102,6 +104,8 @@
   abort: "series" cannot be used as the name of a patch
   abort: "status" cannot be used as the name of a patch
   abort: "guards" cannot be used as the name of a patch
+  abort: "." cannot be used as the name of a patch
+  abort: ".." cannot be used as the name of a patch
   abort: ".hgignore" cannot be used as the name of a patch
   abort: ".mqfoo" cannot be used as the name of a patch
   abort: "foo#bar" cannot be used as the name of a patch
@@ -167,6 +171,8 @@
   abort: "series" cannot be used as the name of a patch
   abort: "status" cannot be used as the name of a patch
   abort: "guards" cannot be used as the name of a patch
+  abort: "." cannot be used as the name of a patch
+  abort: ".." cannot be used as the name of a patch
   abort: ".hgignore" cannot be used as the name of a patch
   abort: ".mqfoo" cannot be used as the name of a patch
   abort: "foo#bar" cannot be used as the name of a patch
--- a/tests/test-subrepo-svn.t	Fri Apr 29 18:19:08 2011 -0300
+++ b/tests/test-subrepo-svn.t	Sun May 01 05:53:28 2011 -0500
@@ -438,3 +438,54 @@
   $ svnversion
   2
   $ cd ..
+
+Test case where subversion would fail to update the subrepo because there
+are unknown directories being replaced by tracked ones (happens with rebase).
+
+  $ cd $WCROOT/src
+  $ mkdir dir
+  $ echo epsilon.py > dir/epsilon.py
+  $ svn add dir
+  A         dir
+  A         dir/epsilon.py
+  $ svn ci -m 'Add dir/epsilon.py'
+  Adding         src/dir
+  Adding         src/dir/epsilon.py
+  Transmitting file data .
+  Committed revision 6.
+  $ cd ../..
+  $ hg init rebaserepo
+  $ cd rebaserepo
+  $ svn co -r5 --quiet "$SVNREPO"/src s
+  $ echo "s =        [svn]       $SVNREPO/src" >> .hgsub
+  $ hg add .hgsub
+  $ hg ci -m addsub
+  committing subrepository s
+  $ echo a > a
+  $ hg ci -Am adda
+  adding a
+  $ hg up 0
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ svn up -r6 s
+  A    s/dir
+  A    s/dir/epsilon.py
+  
+  Fetching external item into 's/externals'
+  Updated external to revision 1.
+  
+  Updated to revision 6.
+  $ hg ci -m updatesub
+  committing subrepository s
+  created new head
+  $ echo pyc > s/dir/epsilon.pyc
+  $ hg up 1
+  D    $TESTTMP/rebaserepo/s/dir
+  
+  Fetching external item into '$TESTTMP/rebaserepo/s/externals'
+  Checked out external at revision 1.
+  
+  Checked out revision 5.
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ if "$TESTDIR/hghave" -q svn15; then
+  > hg up 2 >/dev/null 2>&1 || echo update failed
+  > fi