changeset 23244:18cc87e4375a

merge with stable
author Matt Mackall <mpm@selenic.com>
date Mon, 10 Nov 2014 17:29:15 -0600
parents c58432685cff (current diff) a0ccb66f344d (diff)
children def27d46a9a8
files mercurial/changegroup.py
diffstat 5 files changed, 81 insertions(+), 48 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/convert/git.py	Fri Nov 07 17:54:59 2014 -0800
+++ b/hgext/convert/git.py	Mon Nov 10 17:29:15 2014 -0600
@@ -99,7 +99,7 @@
         if similarity < 0 or similarity > 100:
             raise util.Abort(_('similarity must be between 0 and 100'))
         if similarity > 0:
-            self.simopt = '--find-copies=%d%%' % similarity
+            self.simopt = '-C%d%%' % similarity
             findcopiesharder = ui.configbool('convert', 'git.findcopiesharder',
                                              False)
             if findcopiesharder:
--- a/mercurial/changegroup.py	Fri Nov 07 17:54:59 2014 -0800
+++ b/mercurial/changegroup.py	Mon Nov 10 17:29:15 2014 -0600
@@ -339,6 +339,11 @@
             mfs.setdefault(c[0], x)
             return x
 
+        for chunk in self.group(clnodes, cl, lookupcl, units=_('changesets'),
+                                reorder=reorder):
+            yield chunk
+        progress(msgbundling, None)
+
         # Callback for the manifest, used to collect linkrevs for filelog
         # revisions.
         # Returns the linkrev node (collected in lookupcl).
@@ -350,16 +355,9 @@
                     if f in changedfiles:
                         # record the first changeset introducing this filelog
                         # version
-                        fnodes[f].setdefault(n, clnode)
+                        fnodes.setdefault(f, {}).setdefault(n, clnode)
             return clnode
 
-        for chunk in self.group(clnodes, cl, lookupcl, units=_('changesets'),
-                                reorder=reorder):
-            yield chunk
-        progress(msgbundling, None)
-
-        for f in changedfiles:
-            fnodes[f] = {}
         mfnodes = self.prune(mf, mfs, commonrevs, source)
         for chunk in self.group(mfnodes, mf, lookupmf, units=_('manifests'),
                                 reorder=reorder):
@@ -377,7 +375,7 @@
                         linkrev = llr(r)
                         if linkrev in needed:
                             yield filerevlog.node(r), cl.node(linkrev)
-                fnodes[fname] = dict(genfilenodes())
+                return dict(genfilenodes())
             return fnodes.get(fname, {})
 
         for chunk in self.generatefiles(changedfiles, linknodes, commonrevs,
--- a/mercurial/hgweb/webcommands.py	Fri Nov 07 17:54:59 2014 -0800
+++ b/mercurial/hgweb/webcommands.py	Mon Nov 10 17:29:15 2014 -0600
@@ -901,7 +901,7 @@
 
     ctx = webutil.changectx(web.repo, req)
     pats = []
-    matchfn = None
+    matchfn = scmutil.match(ctx, [])
     file = req.form.get('file', None)
     if file:
         pats = ['path:' + file[0]]
--- a/mercurial/mail.py	Fri Nov 07 17:54:59 2014 -0800
+++ b/mercurial/mail.py	Mon Nov 10 17:29:15 2014 -0600
@@ -104,6 +104,7 @@
         if util.parsebool(verifycert) is not False:
             raise util.Abort(_('invalid smtp.verifycert configuration: %s')
                              % (verifycert))
+        verifycert = False
     if (starttls or smtps) and verifycert:
         sslkwargs = sslutil.sslkwargs(ui, mailhost)
     else:
--- a/tests/test-archive.t	Fri Nov 07 17:54:59 2014 -0800
+++ b/tests/test-archive.t	Mon Nov 10 17:29:15 2014 -0600
@@ -12,8 +12,15 @@
   $ echo bletch>baz/bletch
   $ hg commit -Am 3 -d '1000000000 0'
   adding baz/bletch
+  $ hg init subrepo
+  $ touch subrepo/sub
+  $ hg -q -R subrepo ci -Am "init subrepo"
+  $ echo "subrepo = subrepo" > .hgsub
+  $ hg add .hgsub
+  $ hg ci -m "add subrepo"
   $ echo "[web]" >> .hg/hgrc
   $ echo "name = test-archive" >> .hg/hgrc
+  $ echo "archivesubrepos = True" >> .hg/hgrc
   $ cp .hg/hgrc .hg/hgrc-base
   > test_archtype() {
   >     echo "allow_archive = $1" >> .hg/hgrc
@@ -83,30 +90,39 @@
   >     sys.stderr.write(str(e) + '\n')
   > EOF
   $ python getarchive.py "$TIP" gz | gunzip | tar tf - 2>/dev/null
-  test-archive-2c0277f05ed4/.hg_archival.txt
-  test-archive-2c0277f05ed4/bar
-  test-archive-2c0277f05ed4/baz/bletch
-  test-archive-2c0277f05ed4/foo
+  test-archive-1701ef1f1510/.hg_archival.txt
+  test-archive-1701ef1f1510/.hgsub
+  test-archive-1701ef1f1510/.hgsubstate
+  test-archive-1701ef1f1510/bar
+  test-archive-1701ef1f1510/baz/bletch
+  test-archive-1701ef1f1510/foo
+  test-archive-1701ef1f1510/subrepo/sub
   $ python getarchive.py "$TIP" bz2 | bunzip2 | tar tf - 2>/dev/null
-  test-archive-2c0277f05ed4/.hg_archival.txt
-  test-archive-2c0277f05ed4/bar
-  test-archive-2c0277f05ed4/baz/bletch
-  test-archive-2c0277f05ed4/foo
+  test-archive-1701ef1f1510/.hg_archival.txt
+  test-archive-1701ef1f1510/.hgsub
+  test-archive-1701ef1f1510/.hgsubstate
+  test-archive-1701ef1f1510/bar
+  test-archive-1701ef1f1510/baz/bletch
+  test-archive-1701ef1f1510/foo
+  test-archive-1701ef1f1510/subrepo/sub
   $ python getarchive.py "$TIP" zip > archive.zip
   $ unzip -t archive.zip
   Archive:  archive.zip
-      testing: test-archive-2c0277f05ed4/.hg_archival.txt   OK
-      testing: test-archive-2c0277f05ed4/bar   OK
-      testing: test-archive-2c0277f05ed4/baz/bletch   OK
-      testing: test-archive-2c0277f05ed4/foo   OK
+      testing: test-archive-1701ef1f1510/.hg_archival.txt   OK
+      testing: test-archive-1701ef1f1510/.hgsub   OK
+      testing: test-archive-1701ef1f1510/.hgsubstate   OK
+      testing: test-archive-1701ef1f1510/bar   OK
+      testing: test-archive-1701ef1f1510/baz/bletch   OK
+      testing: test-archive-1701ef1f1510/foo   OK
+      testing: test-archive-1701ef1f1510/subrepo/sub   OK
   No errors detected in compressed data of archive.zip.
 
 test that we can download single directories and files
 
   $ python getarchive.py "$TIP" gz baz | gunzip | tar tf - 2>/dev/null
-  test-archive-2c0277f05ed4/baz/bletch
+  test-archive-1701ef1f1510/baz/bletch
   $ python getarchive.py "$TIP" gz foo | gunzip | tar tf - 2>/dev/null
-  test-archive-2c0277f05ed4/foo
+  test-archive-1701ef1f1510/foo
 
 test that we detect file patterns that match no files
 
@@ -123,29 +139,39 @@
   $ hg archive -t tar test.tar
   $ tar tf test.tar
   test/.hg_archival.txt
+  test/.hgsub
+  test/.hgsubstate
   test/bar
   test/baz/bletch
   test/foo
 
   $ hg archive --debug -t tbz2 -X baz test.tar.bz2
-  archiving: 0/2 files (0.00%)
-  archiving: bar 1/2 files (50.00%)
-  archiving: foo 2/2 files (100.00%)
+  archiving: 0/4 files (0.00%)
+  archiving: .hgsub 1/4 files (25.00%)
+  archiving: .hgsubstate 2/4 files (50.00%)
+  archiving: bar 3/4 files (75.00%)
+  archiving: foo 4/4 files (100.00%)
   $ bunzip2 -dc test.tar.bz2 | tar tf - 2>/dev/null
   test/.hg_archival.txt
+  test/.hgsub
+  test/.hgsubstate
   test/bar
   test/foo
 
   $ hg archive -t tgz -p %b-%h test-%h.tar.gz
   $ gzip -dc test-$QTIP.tar.gz | tar tf - 2>/dev/null
-  test-2c0277f05ed4/.hg_archival.txt
-  test-2c0277f05ed4/bar
-  test-2c0277f05ed4/baz/bletch
-  test-2c0277f05ed4/foo
+  test-1701ef1f1510/.hg_archival.txt
+  test-1701ef1f1510/.hgsub
+  test-1701ef1f1510/.hgsubstate
+  test-1701ef1f1510/bar
+  test-1701ef1f1510/baz/bletch
+  test-1701ef1f1510/foo
 
   $ hg archive autodetected_test.tar
   $ tar tf autodetected_test.tar
   autodetected_test/.hg_archival.txt
+  autodetected_test/.hgsub
+  autodetected_test/.hgsubstate
   autodetected_test/bar
   autodetected_test/baz/bletch
   autodetected_test/foo
@@ -155,6 +181,8 @@
   $ hg archive -t tar autodetect_override_test.zip
   $ tar tf autodetect_override_test.zip
   autodetect_override_test.zip/.hg_archival.txt
+  autodetect_override_test.zip/.hgsub
+  autodetect_override_test.zip/.hgsubstate
   autodetect_override_test.zip/bar
   autodetect_override_test.zip/baz/bletch
   autodetect_override_test.zip/foo
@@ -203,10 +231,12 @@
   No errors detected in compressed data of test.zip.
 
   $ hg archive -t tar - | tar tf - 2>/dev/null
-  test-2c0277f05ed4/.hg_archival.txt
-  test-2c0277f05ed4/bar
-  test-2c0277f05ed4/baz/bletch
-  test-2c0277f05ed4/foo
+  test-1701ef1f1510/.hg_archival.txt
+  test-1701ef1f1510/.hgsub
+  test-1701ef1f1510/.hgsubstate
+  test-1701ef1f1510/bar
+  test-1701ef1f1510/baz/bletch
+  test-1701ef1f1510/foo
 
   $ hg archive -r 0 -t tar rev-%r.tar
   $ [ -f rev-0.tar ]
@@ -216,10 +246,10 @@
   $ hg archive ../test-tags
   $ cat ../test-tags/.hg_archival.txt
   repo: daa7f7c60e0a224faa4ff77ca41b2760562af264
-  node: 2c0277f05ed49d1c8328fb9ba92fba7a5ebcb33e
+  node: 1701ef1f151069b8747038e93b5186bb43a47504
   branch: default
   latesttag: null
-  latesttagdistance: 3
+  latesttagdistance: 4
   $ hg tag -r 2 mytag
   $ hg tag -r 2 anothertag
   $ hg archive -r 2 ../test-lasttag
@@ -250,16 +280,20 @@
 
   $ hg archive ../with-progress
   \r (no-eol) (esc)
-  archiving [                                           ] 0/4\r (no-eol) (esc)
-  archiving [                                           ] 0/4\r (no-eol) (esc)
-  archiving [=========>                                 ] 1/4\r (no-eol) (esc)
-  archiving [=========>                                 ] 1/4\r (no-eol) (esc)
-  archiving [====================>                      ] 2/4\r (no-eol) (esc)
-  archiving [====================>                      ] 2/4\r (no-eol) (esc)
-  archiving [===============================>           ] 3/4\r (no-eol) (esc)
-  archiving [===============================>           ] 3/4\r (no-eol) (esc)
-  archiving [==========================================>] 4/4\r (no-eol) (esc)
-  archiving [==========================================>] 4/4\r (no-eol) (esc)
+  archiving [                                           ] 0/6\r (no-eol) (esc)
+  archiving [                                           ] 0/6\r (no-eol) (esc)
+  archiving [======>                                    ] 1/6\r (no-eol) (esc)
+  archiving [======>                                    ] 1/6\r (no-eol) (esc)
+  archiving [=============>                             ] 2/6\r (no-eol) (esc)
+  archiving [=============>                             ] 2/6\r (no-eol) (esc)
+  archiving [====================>                      ] 3/6\r (no-eol) (esc)
+  archiving [====================>                      ] 3/6\r (no-eol) (esc)
+  archiving [===========================>               ] 4/6\r (no-eol) (esc)
+  archiving [===========================>               ] 4/6\r (no-eol) (esc)
+  archiving [==================================>        ] 5/6\r (no-eol) (esc)
+  archiving [==================================>        ] 5/6\r (no-eol) (esc)
+  archiving [==========================================>] 6/6\r (no-eol) (esc)
+  archiving [==========================================>] 6/6\r (no-eol) (esc)
                                                               \r (no-eol) (esc)
 
 cleanup after progress extension test: