merge with stable
authorMatt Mackall <mpm@selenic.com>
Tue, 08 May 2012 12:05:45 -0500
changeset 16603 ddd4996740c7
parent 16602 80aef0bc5ba7 (current diff)
parent 16598 20a9d823f242 (diff)
child 16610 f1745323a567
child 16666 b9bef21cd214
merge with stable
mercurial/commands.py
tests/test-largefiles.t
--- a/hgext/largefiles/proto.py	Sun May 06 14:37:51 2012 -0500
+++ b/hgext/largefiles/proto.py	Tue May 08 12:05:45 2012 -0500
@@ -20,8 +20,10 @@
     user cache.'''
     proto.redirect()
 
-    tmpfp = util.atomictempfile(lfutil.storepath(repo, sha),
-                                createmode=repo.store.createmode)
+    path = lfutil.storepath(repo, sha)
+    util.makedirs(os.path.dirname(path))
+    tmpfp = util.atomictempfile(path, createmode=repo.store.createmode)
+
     try:
         try:
             proto.getfile(tmpfp)
--- a/mercurial/commands.py	Sun May 06 14:37:51 2012 -0500
+++ b/mercurial/commands.py	Tue May 08 12:05:45 2012 -0500
@@ -647,6 +647,7 @@
         try:
             while changesets:
                 # update state
+                hbisect.save_state(repo, state)
                 status = util.system(command, out=ui.fout)
                 if status == 125:
                     transition = "skip"
--- a/mercurial/parsers.c	Sun May 06 14:37:51 2012 -0500
+++ b/mercurial/parsers.c	Tue May 08 12:05:45 2012 -0500
@@ -983,6 +983,7 @@
 	self->ntdepth = self->ntsplits = 0;
 	self->ntlookups = self->ntmisses = 0;
 	self->ntrev = -1;
+	Py_INCREF(self->data);
 
 	if (self->inlined) {
 		long len = inline_scan(self, NULL);
@@ -998,7 +999,6 @@
 		self->raw_length = size / 64;
 		self->length = self->raw_length + 1;
 	}
-	Py_INCREF(self->data);
 
 	return 0;
 bail:
--- a/mercurial/pure/base85.py	Sun May 06 14:37:51 2012 -0500
+++ b/mercurial/pure/base85.py	Tue May 08 12:05:45 2012 -0500
@@ -54,9 +54,10 @@
             try:
                 acc = acc * 85 + _b85dec[c]
             except KeyError:
-                raise TypeError('Bad base85 character at byte %d' % (i + j))
+                raise ValueError('bad base85 character at position %d'
+                                 % (i + j))
         if acc > 4294967295:
-            raise OverflowError('Base85 overflow in hunk starting at byte %d' % i)
+            raise ValueError('Base85 overflow in hunk starting at byte %d' % i)
         out.append(acc)
 
     # Pad final chunk if necessary
--- a/mercurial/subrepo.py	Sun May 06 14:37:51 2012 -0500
+++ b/mercurial/subrepo.py	Tue May 08 12:05:45 2012 -0500
@@ -43,8 +43,16 @@
     rev = {}
     if '.hgsubstate' in ctx:
         try:
-            for l in ctx['.hgsubstate'].data().splitlines():
-                revision, path = l.split(" ", 1)
+            for i, l in enumerate(ctx['.hgsubstate'].data().splitlines()):
+                l = l.lstrip()
+                if not l:
+                    continue
+                try:
+                    revision, path = l.split(" ", 1)
+                except ValueError:
+                    raise util.Abort(_("invalid subrepository revision "
+                                       "specifier in .hgsubstate line %d")
+                                     % (i + 1))
                 rev[path] = revision
         except IOError, err:
             if err.errno != errno.ENOENT:
--- a/tests/test-check-code-hg.t	Sun May 06 14:37:51 2012 -0500
+++ b/tests/test-check-code-hg.t	Tue May 08 12:05:45 2012 -0500
@@ -496,9 +496,6 @@
   mercurial/patch.py:0:
    >     except:
    warning: naked except clause
-  mercurial/pure/base85.py:0:
-   >             raise OverflowError('Base85 overflow in hunk starting at byte %d' % i)
-   warning: line over 80 characters
   mercurial/pure/mpatch.py:0:
    >         frags.extend(reversed(new))                    # what was left at the end
    warning: line over 80 characters
--- a/tests/test-largefiles.t	Sun May 06 14:37:51 2012 -0500
+++ b/tests/test-largefiles.t	Tue May 08 12:05:45 2012 -0500
@@ -952,6 +952,31 @@
   [255]
   $ rm -rf empty
 
+Push a largefiles repository to a served empty repository
+  $ hg init r8
+  $ echo c3 > r8/f1
+  $ hg add --large r8/f1 -R r8
+  $ hg commit -m "m1" -R r8
+  Invoking status precommit hook
+  A f1
+  $ hg init empty
+  $ hg serve -R empty -d -p $HGPORT2 --pid-file hg.pid \
+  >   --config 'web.allow_push=*' --config web.push_ssl=False
+  $ cat hg.pid >> $DAEMON_PIDS
+  $ rm ${USERCACHE}/*
+  $ hg push -R r8 http://localhost:$HGPORT2
+  pushing to http://localhost:$HGPORT2/
+  searching for changes
+  searching for changes
+  remote: adding changesets
+  remote: adding manifests
+  remote: adding file changes
+  remote: added 1 changesets with 1 changes to 1 files
+  $ rm -rf empty
+
+used all HGPORTs, kill all daemons
+  $ "$TESTDIR/killdaemons.py"
+
 Clone a local repository owned by another user
 We have to simulate that here by setting $HOME and removing write permissions
   $ ORIGHOME="$HOME"
--- a/tests/test-subrepo-missing.t	Sun May 06 14:37:51 2012 -0500
+++ b/tests/test-subrepo-missing.t	Tue May 08 12:05:45 2012 -0500
@@ -12,6 +12,22 @@
   adding b
   $ hg ci -m updatedsub
 
+ignore blanklines in .hgsubstate
+
+  >>> file('.hgsubstate', 'wb').write('\n\n   \t \n   \n')
+  $ hg st --subrepos
+  M .hgsubstate
+  $ hg revert -qC .hgsubstate
+
+abort more gracefully on .hgsubstate parsing error
+
+  $ cp .hgsubstate .hgsubstate.old
+  >>> file('.hgsubstate', 'wb').write('\ninvalid')
+  $ hg st --subrepos
+  abort: invalid subrepository revision specifier in .hgsubstate line 2
+  [255]
+  $ mv .hgsubstate.old .hgsubstate
+
 delete .hgsub and revert it
 
   $ rm .hgsub