tests/test-mq-safety
author Gilles Moris <gilles.moris@free.fr>
Thu, 21 Feb 2008 08:52:52 +0100
changeset 6161 bc1ba9124799
parent 5980 dcda0c90125c
child 8523 5b7da468531b
permissions -rwxr-xr-x
Reverse the way backout is doing the merge Currently, backout is creating a backout revision as a child node of the backed out node and will leave you at this new head. This has several drawbacks: * this changes the current head * when there is a long history between the backed out node and the current head, this will generate a huge number of diffs that are scary at first sight, and not very natural to review before commit. The change consists to switch back to the original node as soon as the backout node (which becomes the new tip) has been created. Then the --merge option can just merge this new tip in the current node. * the current head/node is not changed from the user's point of view * even without using the --merge option, the backout revision is still easy to locate, as this is the tip * the merge is much more intuitive as diffs of the merge is right you are looking to backout
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5980
dcda0c90125c mq: pop/refresh: avoid losing revisions not managed by mq
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
     1
#!/bin/sh
dcda0c90125c mq: pop/refresh: avoid losing revisions not managed by mq
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
     2
dcda0c90125c mq: pop/refresh: avoid losing revisions not managed by mq
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
     3
echo '[extensions]' >> $HGRCPATH
dcda0c90125c mq: pop/refresh: avoid losing revisions not managed by mq
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
     4
echo 'hgext.mq =' >> $HGRCPATH
dcda0c90125c mq: pop/refresh: avoid losing revisions not managed by mq
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
     5
dcda0c90125c mq: pop/refresh: avoid losing revisions not managed by mq
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
     6
hg init repo
dcda0c90125c mq: pop/refresh: avoid losing revisions not managed by mq
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
     7
cd repo
dcda0c90125c mq: pop/refresh: avoid losing revisions not managed by mq
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
     8
dcda0c90125c mq: pop/refresh: avoid losing revisions not managed by mq
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
     9
echo foo > foo
dcda0c90125c mq: pop/refresh: avoid losing revisions not managed by mq
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    10
hg ci -qAm 'add a file'
dcda0c90125c mq: pop/refresh: avoid losing revisions not managed by mq
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    11
dcda0c90125c mq: pop/refresh: avoid losing revisions not managed by mq
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    12
hg qinit
dcda0c90125c mq: pop/refresh: avoid losing revisions not managed by mq
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    13
dcda0c90125c mq: pop/refresh: avoid losing revisions not managed by mq
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    14
hg qnew foo
dcda0c90125c mq: pop/refresh: avoid losing revisions not managed by mq
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    15
echo foo >> foo
dcda0c90125c mq: pop/refresh: avoid losing revisions not managed by mq
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    16
hg qrefresh -m 'append foo'
dcda0c90125c mq: pop/refresh: avoid losing revisions not managed by mq
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    17
dcda0c90125c mq: pop/refresh: avoid losing revisions not managed by mq
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    18
hg qnew bar
dcda0c90125c mq: pop/refresh: avoid losing revisions not managed by mq
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    19
echo bar >> foo
dcda0c90125c mq: pop/refresh: avoid losing revisions not managed by mq
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    20
hg qrefresh -m 'append bar'
dcda0c90125c mq: pop/refresh: avoid losing revisions not managed by mq
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    21
dcda0c90125c mq: pop/refresh: avoid losing revisions not managed by mq
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    22
echo '% try to commit on top of a patch'
dcda0c90125c mq: pop/refresh: avoid losing revisions not managed by mq
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    23
echo quux >> foo
dcda0c90125c mq: pop/refresh: avoid losing revisions not managed by mq
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    24
hg ci -m 'append quux'
dcda0c90125c mq: pop/refresh: avoid losing revisions not managed by mq
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    25
dcda0c90125c mq: pop/refresh: avoid losing revisions not managed by mq
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    26
# cheat a bit...
dcda0c90125c mq: pop/refresh: avoid losing revisions not managed by mq
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    27
mv .hg/patches .hg/patches2
dcda0c90125c mq: pop/refresh: avoid losing revisions not managed by mq
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    28
hg ci -m 'append quux'
dcda0c90125c mq: pop/refresh: avoid losing revisions not managed by mq
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    29
mv .hg/patches2 .hg/patches
dcda0c90125c mq: pop/refresh: avoid losing revisions not managed by mq
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    30
dcda0c90125c mq: pop/refresh: avoid losing revisions not managed by mq
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    31
echo '% qpop/qrefresh on the wrong revision'
dcda0c90125c mq: pop/refresh: avoid losing revisions not managed by mq
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    32
hg qpop
dcda0c90125c mq: pop/refresh: avoid losing revisions not managed by mq
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    33
hg qpop -n patches 2>&1 | sed -e 's/\(using patch queue:\).*/\1/'
dcda0c90125c mq: pop/refresh: avoid losing revisions not managed by mq
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    34
hg qrefresh
dcda0c90125c mq: pop/refresh: avoid losing revisions not managed by mq
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    35
dcda0c90125c mq: pop/refresh: avoid losing revisions not managed by mq
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    36
hg up -C qtip
dcda0c90125c mq: pop/refresh: avoid losing revisions not managed by mq
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    37
echo '% qpop'
dcda0c90125c mq: pop/refresh: avoid losing revisions not managed by mq
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    38
hg qpop
dcda0c90125c mq: pop/refresh: avoid losing revisions not managed by mq
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    39
dcda0c90125c mq: pop/refresh: avoid losing revisions not managed by mq
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    40
echo '% qrefresh'
dcda0c90125c mq: pop/refresh: avoid losing revisions not managed by mq
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    41
hg qrefresh
dcda0c90125c mq: pop/refresh: avoid losing revisions not managed by mq
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    42
dcda0c90125c mq: pop/refresh: avoid losing revisions not managed by mq
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    43
echo '% tip:'
dcda0c90125c mq: pop/refresh: avoid losing revisions not managed by mq
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    44
hg tip --template '#rev# #desc#\n'