Merge with stable
authorMatt Mackall <mpm@selenic.com>
Mon, 19 Apr 2010 17:00:02 -0500
changeset 10962 8d5f5122a732
parent 10961 ce6d56b95f2e (current diff)
parent 10954 33119d0252c1 (diff)
child 10963 9e314c5e6890
Merge with stable
hgext/mq.py
mercurial/cmdutil.py
mercurial/commands.py
mercurial/dispatch.py
mercurial/subrepo.py
--- a/hgext/convert/cvsps.py	Fri Apr 16 23:59:43 2010 +0200
+++ b/hgext/convert/cvsps.py	Mon Apr 19 17:00:02 2010 -0500
@@ -402,6 +402,8 @@
             branchpoints = set()
             for branch, revision in branchmap.iteritems():
                 revparts = tuple([int(i) for i in revision.split('.')])
+                if len(revparts) < 2: # bad tags
+                    continue
                 if revparts[-2] == 0 and revparts[-1] % 2 == 0:
                     # normal branch
                     if revparts[:-2] == e.revision:
--- a/hgext/mq.py	Fri Apr 16 23:59:43 2010 +0200
+++ b/hgext/mq.py	Mon Apr 19 17:00:02 2010 -0500
@@ -1420,7 +1420,7 @@
             if summary:
                 ph = patchheader(self.join(patchname), self.plainmode)
                 msg = ph.message and ph.message[0] or ''
-                if self.ui.interactive():
+                if not self.ui.plain():
                     width = util.termwidth() - len(pfx) - len(patchname) - 2
                     if width > 0:
                         msg = util.ellipsis(msg, width)
@@ -2737,7 +2737,7 @@
           ('D', 'currentdate', None, _('add "Date: <current date>" to patch')),
           ('d', 'date', '', _('add "Date: <given date>" to patch'))
           ] + commands.walkopts + commands.commitopts,
-         _('hg qnew [-e] [-m TEXT] [-l FILE] [-f] PATCH [FILE]...')),
+         _('hg qnew [-e] [-m TEXT] [-l FILE] PATCH [FILE]...')),
     "qnext": (next, [] + seriesopts, _('hg qnext [-s]')),
     "qprev": (prev, [] + seriesopts, _('hg qprev [-s]')),
     "^qpop":
--- a/mercurial/cmdutil.py	Fri Apr 16 23:59:43 2010 +0200
+++ b/mercurial/cmdutil.py	Mon Apr 19 17:00:02 2010 -0500
@@ -129,9 +129,10 @@
     if r:
         dst.setconfig('bundle', 'mainreporoot', r)
 
-    # copy auth section settings
-    for key, val in src.configitems('auth'):
-        dst.setconfig('auth', key, val)
+    # copy auth and http_proxy section settings
+    for sect in ('auth', 'http_proxy'):
+        for key, val in src.configitems(sect):
+            dst.setconfig(sect, key, val)
 
     return dst
 
--- a/mercurial/commands.py	Fri Apr 16 23:59:43 2010 +0200
+++ b/mercurial/commands.py	Mon Apr 19 17:00:02 2010 -0500
@@ -1178,7 +1178,9 @@
     m = cmdutil.match(repo, pats, opts)
     if stat:
         it = patch.diff(repo, node1, node2, match=m, opts=diffopts)
-        width = ui.interactive() and util.termwidth() or 80
+        width = 80
+        if not ui.plain():
+            width = util.termwidth()
         for chunk, label in patch.diffstatui(util.iterlines(it), width=width,
                                              git=diffopts.git):
             ui.write(chunk, label=label)
--- a/mercurial/dispatch.py	Fri Apr 16 23:59:43 2010 +0200
+++ b/mercurial/dispatch.py	Mon Apr 19 17:00:02 2010 -0500
@@ -33,10 +33,13 @@
     def catchterm(*args):
         raise error.SignalInterrupt
 
-    for name in 'SIGBREAK', 'SIGHUP', 'SIGTERM':
-        num = getattr(signal, name, None)
-        if num:
-            signal.signal(num, catchterm)
+    try:
+        for name in 'SIGBREAK', 'SIGHUP', 'SIGTERM':
+            num = getattr(signal, name, None)
+            if num:
+                signal.signal(num, catchterm)
+    except ValueError:
+        pass # happens if called in a thread
 
     try:
         try:
--- a/mercurial/hgweb/protocol.py	Fri Apr 16 23:59:43 2010 +0200
+++ b/mercurial/hgweb/protocol.py	Mon Apr 19 17:00:02 2010 -0500
@@ -179,6 +179,8 @@
             raise ErrorResponse(HTTP_OK, inst)
         except (OSError, IOError), inst:
             error = getattr(inst, 'strerror', 'Unknown error')
+            if not isinstance(error, str):
+                error = 'Error: %s' % str(error)
             if inst.errno == errno.ENOENT:
                 code = HTTP_NOT_FOUND
             else:
--- a/mercurial/subrepo.py	Fri Apr 16 23:59:43 2010 +0200
+++ b/mercurial/subrepo.py	Mon Apr 19 17:00:02 2010 -0500
@@ -274,7 +274,8 @@
         self._ui = ctx._repo.ui
 
     def _svncommand(self, commands):
-        cmd = ['svn'] + commands + [self._path]
+        path = os.path.join(self._ctx._repo.origroot, self._path)
+        cmd = ['svn'] + commands + [path]
         cmd = [util.shellquote(arg) for arg in cmd]
         cmd = util.quotecommand(' '.join(cmd))
         env = dict(os.environ)
--- a/mercurial/templates/template-vars.txt	Fri Apr 16 23:59:43 2010 +0200
+++ b/mercurial/templates/template-vars.txt	Mon Apr 19 17:00:02 2010 -0500
@@ -28,6 +28,10 @@
 annotate      an annotated file
 entries       the entries relevant to the page
 
+url           base url of hgweb interface
+staticurl     base url for static resources
+
+
 Templates and commands:
   changelog(rev) - a page for browsing changesets
     naventry - a link for jumping to a changeset number
--- a/tests/test-subrepo-svn	Fri Apr 16 23:59:43 2010 +0200
+++ b/tests/test-subrepo-svn	Mon Apr 19 17:00:02 2010 -0500
@@ -16,7 +16,8 @@
 fi
 escapedwd=`python -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$escapedwd"`
 filterpath="s|$escapedwd|/root|"
-filtersvn='s/ in transaction.*/ is out of date/;s/Out of date: /File /'
+filteroutofdate='s/ in transaction.*/ is out of date/;s/Out of date: /File /'
+filterexternal="s|Fetching external item into '.*/s/externals'|Fetching external item into 's/externals'|g"
 
 echo % create subversion repo
 
@@ -62,7 +63,7 @@
 echo % change file in svn and hg, commit
 echo a >> a
 echo alpha >> s/alpha
-hg commit -m 'Message!'
+hg commit -m 'Message!' | sed "$filterexternal"
 hg debugsub | sed "$filterpath"
 
 echo
@@ -81,12 +82,12 @@
 
 echo % this commit from hg will fail
 echo zzz >> s/alpha
-hg ci -m 'amend alpha from hg' 2>&1 | sed "$filtersvn"
+hg ci -m 'amend alpha from hg' 2>&1 | sed "$filteroutofdate"
 svn revert -q s/alpha
 
 echo % this commit fails because of meta changes
 svn propset svn:mime-type 'text/html' s/alpha
-hg ci -m 'amend alpha from hg' 2>&1 | sed "$filtersvn"
+hg ci -m 'amend alpha from hg' 2>&1 | sed "$filteroutofdate"
 svn revert -q s/alpha
 
 echo % this commit fails because of externals changes
@@ -106,3 +107,6 @@
 cd tc
 echo % debugsub in clone
 hg debugsub | sed "$filterpath"
+
+echo % verify subrepo is contained within the repo directory
+python -c "import os.path; print os.path.exists('s')"
--- a/tests/test-subrepo-svn.out	Fri Apr 16 23:59:43 2010 +0200
+++ b/tests/test-subrepo-svn.out	Mon Apr 19 17:00:02 2010 -0500
@@ -72,11 +72,11 @@
 
 % clone
 updating to branch default
-A    s/alpha
- U   s
+A    tc/s/alpha
+ U   tc/s
 
-Fetching external item into 's/externals'
-A    s/externals/other
+Fetching external item into 'tc/s/externals'
+A    tc/s/externals/other
 Checked out external at revision 1.
 
 Checked out revision 3.
@@ -85,3 +85,5 @@
 path s
  source   file:///root/svn-repo/src
  revision 3
+% verify subrepo is contained within the repo directory
+True