tests/test-mq-qimport-fail-cleanup
author Nicolas Dumazet <nicdumz.commits@gmail.com>
Sat, 03 Jul 2010 18:11:15 +0900
changeset 11608 183e63112698
parent 11462 1b82a26635d7
permissions -rwxr-xr-x
log: remove increasing windows usage in fastpath The purpose of increasing windows is to allow backwards iteration on the filelog at a reasonable cost. But is it needed? - if follow is False, we have no reason to iterate backwards. We basically just want to walk the complete filelog and yield all revisions within the revision range. We can do this forward or backwards, as it only reads the index. - when follow is True, we need to examine the contents of the filelog, and to do this efficiently we need to read the filelog forward. And on the other hand, to track ancestors and copies, we need to process revisions backwards. But is it necessary to use increasing windows for this? We can iterate over the complete filelog forward, stack the revisions, and read the reversed(pile), it does the same thing with a more readable code.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
11462
1b82a26635d7 mq: qimport cleanup on fail (issue2214)
Vishakh H <vsh426@gmail.com>
parents:
diff changeset
     1
#!/bin/sh
1b82a26635d7 mq: qimport cleanup on fail (issue2214)
Vishakh H <vsh426@gmail.com>
parents:
diff changeset
     2
#failed qimport of patches from files should cleanup by recording successfully
1b82a26635d7 mq: qimport cleanup on fail (issue2214)
Vishakh H <vsh426@gmail.com>
parents:
diff changeset
     3
#imported patches in series file.
1b82a26635d7 mq: qimport cleanup on fail (issue2214)
Vishakh H <vsh426@gmail.com>
parents:
diff changeset
     4
1b82a26635d7 mq: qimport cleanup on fail (issue2214)
Vishakh H <vsh426@gmail.com>
parents:
diff changeset
     5
echo "[extensions]" >> $HGRCPATH
1b82a26635d7 mq: qimport cleanup on fail (issue2214)
Vishakh H <vsh426@gmail.com>
parents:
diff changeset
     6
echo "mq=" >> $HGRCPATH
1b82a26635d7 mq: qimport cleanup on fail (issue2214)
Vishakh H <vsh426@gmail.com>
parents:
diff changeset
     7
1b82a26635d7 mq: qimport cleanup on fail (issue2214)
Vishakh H <vsh426@gmail.com>
parents:
diff changeset
     8
hg init repo
1b82a26635d7 mq: qimport cleanup on fail (issue2214)
Vishakh H <vsh426@gmail.com>
parents:
diff changeset
     9
cd repo
1b82a26635d7 mq: qimport cleanup on fail (issue2214)
Vishakh H <vsh426@gmail.com>
parents:
diff changeset
    10
1b82a26635d7 mq: qimport cleanup on fail (issue2214)
Vishakh H <vsh426@gmail.com>
parents:
diff changeset
    11
echo a > a
1b82a26635d7 mq: qimport cleanup on fail (issue2214)
Vishakh H <vsh426@gmail.com>
parents:
diff changeset
    12
hg ci -Am'add a'
1b82a26635d7 mq: qimport cleanup on fail (issue2214)
Vishakh H <vsh426@gmail.com>
parents:
diff changeset
    13
1b82a26635d7 mq: qimport cleanup on fail (issue2214)
Vishakh H <vsh426@gmail.com>
parents:
diff changeset
    14
cat >b.patch<<EOF
1b82a26635d7 mq: qimport cleanup on fail (issue2214)
Vishakh H <vsh426@gmail.com>
parents:
diff changeset
    15
diff --git a/a b/a
1b82a26635d7 mq: qimport cleanup on fail (issue2214)
Vishakh H <vsh426@gmail.com>
parents:
diff changeset
    16
--- a/a
1b82a26635d7 mq: qimport cleanup on fail (issue2214)
Vishakh H <vsh426@gmail.com>
parents:
diff changeset
    17
+++ b/a
1b82a26635d7 mq: qimport cleanup on fail (issue2214)
Vishakh H <vsh426@gmail.com>
parents:
diff changeset
    18
@@ -1,1 +1,2 @@
1b82a26635d7 mq: qimport cleanup on fail (issue2214)
Vishakh H <vsh426@gmail.com>
parents:
diff changeset
    19
 a
1b82a26635d7 mq: qimport cleanup on fail (issue2214)
Vishakh H <vsh426@gmail.com>
parents:
diff changeset
    20
+b
1b82a26635d7 mq: qimport cleanup on fail (issue2214)
Vishakh H <vsh426@gmail.com>
parents:
diff changeset
    21
EOF
1b82a26635d7 mq: qimport cleanup on fail (issue2214)
Vishakh H <vsh426@gmail.com>
parents:
diff changeset
    22
1b82a26635d7 mq: qimport cleanup on fail (issue2214)
Vishakh H <vsh426@gmail.com>
parents:
diff changeset
    23
echo
1b82a26635d7 mq: qimport cleanup on fail (issue2214)
Vishakh H <vsh426@gmail.com>
parents:
diff changeset
    24
echo '#empty series'
1b82a26635d7 mq: qimport cleanup on fail (issue2214)
Vishakh H <vsh426@gmail.com>
parents:
diff changeset
    25
hg qseries
1b82a26635d7 mq: qimport cleanup on fail (issue2214)
Vishakh H <vsh426@gmail.com>
parents:
diff changeset
    26
1b82a26635d7 mq: qimport cleanup on fail (issue2214)
Vishakh H <vsh426@gmail.com>
parents:
diff changeset
    27
echo
1b82a26635d7 mq: qimport cleanup on fail (issue2214)
Vishakh H <vsh426@gmail.com>
parents:
diff changeset
    28
echo '#qimport valid patch followed by invalid patch'
1b82a26635d7 mq: qimport cleanup on fail (issue2214)
Vishakh H <vsh426@gmail.com>
parents:
diff changeset
    29
hg qimport b.patch fakepatch
1b82a26635d7 mq: qimport cleanup on fail (issue2214)
Vishakh H <vsh426@gmail.com>
parents:
diff changeset
    30
1b82a26635d7 mq: qimport cleanup on fail (issue2214)
Vishakh H <vsh426@gmail.com>
parents:
diff changeset
    31
echo
1b82a26635d7 mq: qimport cleanup on fail (issue2214)
Vishakh H <vsh426@gmail.com>
parents:
diff changeset
    32
echo '#valid patches before fail added to series'
1b82a26635d7 mq: qimport cleanup on fail (issue2214)
Vishakh H <vsh426@gmail.com>
parents:
diff changeset
    33
hg qseries