view tests/test-mq-qimport-fail-cleanup.t @ 37772:814151cd8c4a

logcmdutil: rewrite jsonchangeset printer to be backed by jsonformatter This is a bit slower than the original implementation, but I don't think that would actually matter. It's still faster than full templating. $ hg log -Tjson -r0:5000 --time > /dev/null (orig) time: real 1.550 secs (user 1.500+0.000 sys 0.040+0.000) (new) time: real 1.810 secs (user 1.740+0.000 sys 0.070+0.000) cf. $ hg log -Tdefault -r0:5000 --time > /dev/null time: real 4.980 secs (user 4.850+0.000 sys 0.130+0.000) $ hg log -r0:5000 --time > /dev/null time: real 2.340 secs (user 2.220+0.000 sys 0.100+0.000) $ hg log -r0:5000 -q --time > /dev/null time: real 0.750 secs (user 0.670+0.000 sys 0.070+0.000) The test output changes because keys are sorted alphabetically.
author Yuya Nishihara <yuya@tcha.org>
date Fri, 13 Apr 2018 22:47:14 +0900
parents 0342bf292f73
children
line wrap: on
line source

Failed qimport of patches from files should cleanup by recording successfully
imported patches in series file.

  $ echo "[extensions]" >> $HGRCPATH
  $ echo "mq=" >> $HGRCPATH
  $ hg init repo
  $ cd repo
  $ echo a > a
  $ hg ci -Am'add a'
  adding a
  $ cat >b.patch<<EOF
  > diff --git a/a b/a
  > --- a/a
  > +++ b/a
  > @@ -1,1 +1,2 @@
  >  a
  > +b
  > EOF

empty series

  $ hg qseries

qimport valid patch followed by invalid patch

  $ hg qimport b.patch fakepatch
  adding b.patch to series file
  abort: unable to read file fakepatch
  [255]

valid patches before fail added to series

  $ hg qseries
  b.patch

  $ hg pull -q -r 0 . # update phase
  $ hg qimport -r 0
  abort: revision 0 is not mutable
  (see 'hg help phases' for details)
  [255]

  $ cd ..