##// END OF EJS Templates
wireprotov2: implement commands as a generator of objects...
wireprotov2: implement commands as a generator of objects Previously, wire protocol version 2 inherited version 1's model of having separate types to represent the results of different wire protocol commands. As I implemented more powerful commands in future commits, I found I was using a common pattern of returning a special type to hold a generator. This meant the command function required a closure to do most of the work. That made logic flow more difficult to follow. I also noticed that many commands were effectively a sequence of objects to be CBOR encoded. I think it makes sense to define version 2 commands as generators. This way, commands can simply emit the data structures they wish to send to the client. This eliminates the need for a closure in command functions and removes encoding from the bodies of commands. As part of this commit, the handling of response objects has been moved into the serverreactor class. This puts the reactor in the driver's seat with regards to CBOR encoding and error handling. Having error handling in the function that emits frames is particularly important because exceptions in that function can lead to things getting in a bad state: I'm fairly certain that uncaught exceptions in the frame generator were causing deadlocks. I also introduced a dedicated error type for explicit error reporting in command handlers. This will be used in subsequent commits. There's still a bit of work to be done here, especially around formalizing the error handling "protocol." I've added yet another TODO to track this so we don't forget. Test output changed because we're using generators and no longer know we are at the end of the data until we hit the end of the generator. This means we can't emit the end-of-stream flag until we've exhausted the generator. Hence the introduction of 0-sized end-of-stream frames. Differential Revision: https://phab.mercurial-scm.org/D4472

File last commit:

r38747:02b5b5c1 default
r39595:07b58266 default
Show More
test-histedit-fold.t
599 lines | 12.7 KiB | text/troff | Tads3Lexer
/ tests / test-histedit-fold.t
Mads Kiilerich
spelling: fixes from spell checker
r21024 Test histedit extension: Fold commands
Pierre-Yves David
test: improve documentation of some histedit tests...
r19015 ======================================
This test file is dedicated to testing the fold command in non conflicting
case.
Initialization
---------------
Mads Kiilerich
tests: convert histedit tests to .t...
r17085 $ . "$TESTDIR/histedit-helpers.sh"
$ cat >> $HGRCPATH <<EOF
Pierre-Yves David
test: use a lighter log style in histedit test...
r19014 > [alias]
> logt = log --template '{rev}:{node|short} {desc|firstline}\n'
Mads Kiilerich
tests: convert histedit tests to .t...
r17085 > [extensions]
> histedit=
> EOF
Pierre-Yves David
test: improve documentation of some histedit tests...
r19015
Simple folding
--------------------
Ben Schmidt
histedit: improve documentation and behaviour of dates...
r31055 $ addwithdate ()
> {
> echo $1 > $1
> hg add $1
> hg ci -m $1 -d "$2 0"
> }
Mads Kiilerich
tests: convert histedit tests to .t...
r17085 $ initrepo ()
> {
> hg init r
> cd r
Ben Schmidt
histedit: improve documentation and behaviour of dates...
r31055 > addwithdate a 1
> addwithdate b 2
> addwithdate c 3
> addwithdate d 4
> addwithdate e 5
> addwithdate f 6
Mads Kiilerich
tests: convert histedit tests to .t...
r17085 > }
$ initrepo
log before edit
Pierre-Yves David
test: use a lighter log style in histedit test...
r19014 $ hg logt --graph
Ben Schmidt
histedit: improve documentation and behaviour of dates...
r31055 @ 5:178e35e0ce73 f
Mads Kiilerich
tests: convert histedit tests to .t...
r17085 |
Ben Schmidt
histedit: improve documentation and behaviour of dates...
r31055 o 4:1ddb6c90f2ee e
Mads Kiilerich
tests: convert histedit tests to .t...
r17085 |
Ben Schmidt
histedit: improve documentation and behaviour of dates...
r31055 o 3:532247a8969b d
Mads Kiilerich
tests: convert histedit tests to .t...
r17085 |
Ben Schmidt
histedit: improve documentation and behaviour of dates...
r31055 o 2:ff2c9fa2018b c
Mads Kiilerich
tests: convert histedit tests to .t...
r17085 |
Ben Schmidt
histedit: improve documentation and behaviour of dates...
r31055 o 1:97d72e5f12c7 b
Mads Kiilerich
tests: convert histedit tests to .t...
r17085 |
Ben Schmidt
histedit: improve documentation and behaviour of dates...
r31055 o 0:8580ff50825a a
Mads Kiilerich
tests: convert histedit tests to .t...
r17085
Ben Schmidt
histedit: improve documentation and behaviour of dates...
r31055 $ hg histedit ff2c9fa2018b --commands - 2>&1 <<EOF | fixbundle
> pick 1ddb6c90f2ee e
> pick 178e35e0ce73 f
> fold ff2c9fa2018b c
> pick 532247a8969b d
Pierre-Yves David
test: improve documentation of some histedit tests...
r19015 > EOF
Mads Kiilerich
tests: convert histedit tests to .t...
r17085
log after edit
Pierre-Yves David
test: use a lighter log style in histedit test...
r19014 $ hg logt --graph
Ben Schmidt
histedit: improve documentation and behaviour of dates...
r31055 @ 4:c4d7f3def76d d
Mads Kiilerich
tests: convert histedit tests to .t...
r17085 |
Ben Schmidt
histedit: improve documentation and behaviour of dates...
r31055 o 3:575228819b7e f
Mads Kiilerich
tests: convert histedit tests to .t...
r17085 |
Ben Schmidt
histedit: improve documentation and behaviour of dates...
r31055 o 2:505a591af19e e
Mads Kiilerich
tests: convert histedit tests to .t...
r17085 |
Ben Schmidt
histedit: improve documentation and behaviour of dates...
r31055 o 1:97d72e5f12c7 b
Mads Kiilerich
tests: convert histedit tests to .t...
r17085 |
Ben Schmidt
histedit: improve documentation and behaviour of dates...
r31055 o 0:8580ff50825a a
Mads Kiilerich
tests: convert histedit tests to .t...
r17085
post-fold manifest
$ hg manifest
a
b
c
d
e
f
Pierre-Yves David
histedit: record histedit source (issue3681)...
r18437
Ben Schmidt
histedit: improve documentation and behaviour of dates...
r31055 check histedit_source, including that it uses the later date, from the first changeset
Pierre-Yves David
histedit: record histedit source (issue3681)...
r18437
$ hg log --debug --rev 3
Ben Schmidt
histedit: improve documentation and behaviour of dates...
r31055 changeset: 3:575228819b7e6ed69e8c0a6a383ee59a80db7358
Pierre-Yves David
histedit: record histedit source (issue3681)...
r18437 phase: draft
Ben Schmidt
histedit: improve documentation and behaviour of dates...
r31055 parent: 2:505a591af19eed18f560af827b9e03d2076773dc
Pierre-Yves David
histedit: record histedit source (issue3681)...
r18437 parent: -1:0000000000000000000000000000000000000000
manifest: 3:81eede616954057198ead0b2c73b41d1f392829a
user: test
Ben Schmidt
histedit: improve documentation and behaviour of dates...
r31055 date: Thu Jan 01 00:00:06 1970 +0000
Pierre-Yves David
histedit: record histedit source (issue3681)...
r18437 files+: c f
extra: branch=default
Ben Schmidt
histedit: improve documentation and behaviour of dates...
r31055 extra: histedit_source=7cad1d7030207872dfd1c3a7cb430f24f2884086,ff2c9fa2018b15fa74b33363bda9527323e2a99f
Pierre-Yves David
histedit: record histedit source (issue3681)...
r18437 description:
Pierre-Yves David
histedit-test: generalise --commands "-" usage...
r19019 f
***
c
Pierre-Yves David
histedit: record histedit source (issue3681)...
r18437
Ben Schmidt
histedit: modify rollup to discard date from the rollup commit (issue4820)...
r31056 rollup will fold without preserving the folded commit's message or date
Mike Edgar
histedit: add "roll" command to fold commit data and drop message (issue4256)...
r22152
Durham Goode
histedit: fix rollup prompting for a commit message (issue4606)...
r24828 $ OLDHGEDITOR=$HGEDITOR
$ HGEDITOR=false
Ben Schmidt
histedit: improve documentation and behaviour of dates...
r31055 $ hg histedit 97d72e5f12c7 --commands - 2>&1 <<EOF | fixbundle
> pick 97d72e5f12c7 b
> roll 505a591af19e e
> pick 575228819b7e f
> pick c4d7f3def76d d
Mike Edgar
histedit: add "roll" command to fold commit data and drop message (issue4256)...
r22152 > EOF
Durham Goode
histedit: fix rollup prompting for a commit message (issue4606)...
r24828 $ HGEDITOR=$OLDHGEDITOR
Mike Edgar
histedit: add "roll" command to fold commit data and drop message (issue4256)...
r22152 log after edit
$ hg logt --graph
Ben Schmidt
histedit: modify rollup to discard date from the rollup commit (issue4820)...
r31056 @ 3:bab801520cec d
Mike Edgar
histedit: add "roll" command to fold commit data and drop message (issue4256)...
r22152 |
Ben Schmidt
histedit: modify rollup to discard date from the rollup commit (issue4820)...
r31056 o 2:58c8f2bfc151 f
Mike Edgar
histedit: add "roll" command to fold commit data and drop message (issue4256)...
r22152 |
Ben Schmidt
histedit: modify rollup to discard date from the rollup commit (issue4820)...
r31056 o 1:5d939c56c72e b
Mike Edgar
histedit: add "roll" command to fold commit data and drop message (issue4256)...
r22152 |
Ben Schmidt
histedit: improve documentation and behaviour of dates...
r31055 o 0:8580ff50825a a
Mike Edgar
histedit: add "roll" command to fold commit data and drop message (issue4256)...
r22152
description is taken from rollup target commit
$ hg log --debug --rev 1
Ben Schmidt
histedit: modify rollup to discard date from the rollup commit (issue4820)...
r31056 changeset: 1:5d939c56c72e77e29f5167696218e2131a40f5cf
Mike Edgar
histedit: add "roll" command to fold commit data and drop message (issue4256)...
r22152 phase: draft
Ben Schmidt
histedit: improve documentation and behaviour of dates...
r31055 parent: 0:8580ff50825a50c8f716709acdf8de0deddcd6ab
Mike Edgar
histedit: add "roll" command to fold commit data and drop message (issue4256)...
r22152 parent: -1:0000000000000000000000000000000000000000
manifest: 1:b5e112a3a8354e269b1524729f0918662d847c38
user: test
Ben Schmidt
histedit: modify rollup to discard date from the rollup commit (issue4820)...
r31056 date: Thu Jan 01 00:00:02 1970 +0000
Mike Edgar
histedit: add "roll" command to fold commit data and drop message (issue4256)...
r22152 files+: b e
extra: branch=default
Ben Schmidt
histedit: improve documentation and behaviour of dates...
r31055 extra: histedit_source=97d72e5f12c7e84f85064aa72e5a297142c36ed9,505a591af19eed18f560af827b9e03d2076773dc
Mike Edgar
histedit: add "roll" command to fold commit data and drop message (issue4256)...
r22152 description:
b
FUJIWARA Katsunori
histedit: save manually edited commit message into ".hg/last-message.txt"...
r20770 check saving last-message.txt
Sean Farley
tests: use TESTTMP instead of TESTDIR...
r20859 $ cat > $TESTTMP/abortfolding.py <<EOF
FUJIWARA Katsunori
histedit: save manually edited commit message into ".hg/last-message.txt"...
r20770 > from mercurial import util
> def abortfolding(ui, repo, hooktype, **kwargs):
> ctx = repo[kwargs.get('node')]
Augie Fackler
tests: add bytes prefixes to test-histedit-fold.t's local extension...
r36189 > if set(ctx.files()) == {b'c', b'd', b'f'}:
FUJIWARA Katsunori
histedit: save manually edited commit message into ".hg/last-message.txt"...
r20770 > return True # abort folding commit only
Augie Fackler
tests: add bytes prefixes to test-histedit-fold.t's local extension...
r36189 > ui.warn(b'allow non-folding commit\\n')
FUJIWARA Katsunori
histedit: save manually edited commit message into ".hg/last-message.txt"...
r20770 > EOF
$ cat > .hg/hgrc <<EOF
> [hooks]
Sean Farley
tests: use TESTTMP instead of TESTDIR...
r20859 > pretxncommit.abortfolding = python:$TESTTMP/abortfolding.py:abortfolding
FUJIWARA Katsunori
histedit: save manually edited commit message into ".hg/last-message.txt"...
r20770 > EOF
Sean Farley
tests: use TESTTMP instead of TESTDIR...
r20859 $ cat > $TESTTMP/editor.sh << EOF
FUJIWARA Katsunori
histedit: save manually edited commit message into ".hg/last-message.txt"...
r20770 > echo "==== before editing"
> cat \$1
> echo "===="
> echo "check saving last-message.txt" >> \$1
> EOF
$ rm -f .hg/last-message.txt
Ben Schmidt
histedit: modify rollup to discard date from the rollup commit (issue4820)...
r31056 $ hg status --rev '58c8f2bfc151^1::bab801520cec'
FUJIWARA Katsunori
memctx: calculate exact status being committed from specified files...
r23587 A c
A d
A f
Ben Schmidt
histedit: modify rollup to discard date from the rollup commit (issue4820)...
r31056 $ HGEDITOR="sh $TESTTMP/editor.sh" hg histedit 58c8f2bfc151 --commands - 2>&1 <<EOF
> pick 58c8f2bfc151 f
> fold bab801520cec d
FUJIWARA Katsunori
histedit: save manually edited commit message into ".hg/last-message.txt"...
r20770 > EOF
allow non-folding commit
==== before editing
f
***
c
***
d
HG: Enter commit message. Lines beginning with 'HG:' are removed.
HG: Leave message empty to abort commit.
HG: --
HG: user: test
HG: branch 'default'
FUJIWARA Katsunori
memctx: calculate exact status being committed from specified files...
r23587 HG: added c
HG: added d
HG: added f
FUJIWARA Katsunori
histedit: save manually edited commit message into ".hg/last-message.txt"...
r20770 ====
transaction abort!
rollback completed
abort: pretxncommit.abortfolding hook failed
FUJIWARA Katsunori
memctx: calculate exact status being committed from specified files...
r23587 [255]
FUJIWARA Katsunori
histedit: save manually edited commit message into ".hg/last-message.txt"...
r20770
$ cat .hg/last-message.txt
f
***
c
***
d
check saving last-message.txt
Mads Kiilerich
tests: convert histedit tests to .t...
r17085 $ cd ..
Martin von Zweigbergk
histedit: preserve initial author on fold (issue4296)...
r22147 $ rm -r r
Ben Schmidt
histedit: improve documentation and behaviour of dates...
r31055 folding preserves initial author but uses later date
----------------------------------------------------
Martin von Zweigbergk
histedit: preserve initial author on fold (issue4296)...
r22147
$ initrepo
Ben Schmidt
histedit: improve documentation and behaviour of dates...
r31055 $ hg ci -d '7 0' --user "someone else" --amend --quiet
Martin von Zweigbergk
histedit: preserve initial author on fold (issue4296)...
r22147
tip before edit
$ hg log --rev .
Ben Schmidt
histedit: improve documentation and behaviour of dates...
r31055 changeset: 5:10c36dd37515
Martin von Zweigbergk
histedit: preserve initial author on fold (issue4296)...
r22147 tag: tip
user: someone else
Ben Schmidt
histedit: improve documentation and behaviour of dates...
r31055 date: Thu Jan 01 00:00:07 1970 +0000
Martin von Zweigbergk
histedit: preserve initial author on fold (issue4296)...
r22147 summary: f
timeless
histedit: add progress support
r27451 $ hg --config progress.debug=1 --debug \
Ben Schmidt
histedit: improve documentation and behaviour of dates...
r31055 > histedit 1ddb6c90f2ee --commands - 2>&1 <<EOF | \
timeless
histedit: add progress support
r27451 > egrep 'editing|unresolved'
Ben Schmidt
histedit: improve documentation and behaviour of dates...
r31055 > pick 1ddb6c90f2ee e
> fold 10c36dd37515 f
Martin von Zweigbergk
histedit: preserve initial author on fold (issue4296)...
r22147 > EOF
Ben Schmidt
histedit: improve documentation and behaviour of dates...
r31055 editing: pick 1ddb6c90f2ee 4 e 1/2 changes (50.00%)
editing: fold 10c36dd37515 5 f 2/2 changes (100.00%)
Martin von Zweigbergk
histedit: preserve initial author on fold (issue4296)...
r22147
Ben Schmidt
histedit: improve documentation and behaviour of dates...
r31055 tip after edit, which should use the later date, from the second changeset
Martin von Zweigbergk
histedit: preserve initial author on fold (issue4296)...
r22147 $ hg log --rev .
Ben Schmidt
histedit: improve documentation and behaviour of dates...
r31055 changeset: 4:e4f3ec5d0b40
Martin von Zweigbergk
histedit: preserve initial author on fold (issue4296)...
r22147 tag: tip
user: test
Ben Schmidt
histedit: improve documentation and behaviour of dates...
r31055 date: Thu Jan 01 00:00:07 1970 +0000
Martin von Zweigbergk
histedit: preserve initial author on fold (issue4296)...
r22147 summary: e
$ cd ..
$ rm -r r
Augie Fackler
histedit: don't crash if the result of fixing up a fold is empty
r17130
folding and creating no new change doesn't break:
Pierre-Yves David
test: improve documentation of some histedit tests...
r19015 -------------------------------------------------
Mads Kiilerich
spelling: fixes from spell checker
r21024 folded content is dropped during a merge. The folded commit should properly disappear.
Pierre-Yves David
test: improve documentation of some histedit tests...
r19015
Augie Fackler
histedit: don't crash if the result of fixing up a fold is empty
r17130 $ mkdir fold-to-empty-test
$ cd fold-to-empty-test
$ hg init
$ printf "1\n2\n3\n" > file
$ hg add file
$ hg commit -m '1+2+3'
$ echo 4 >> file
$ hg commit -m '+4'
$ echo 5 >> file
$ hg commit -m '+5'
$ echo 6 >> file
$ hg commit -m '+6'
Pierre-Yves David
test: use a lighter log style in histedit test...
r19014 $ hg logt --graph
@ 3:251d831eeec5 +6
Augie Fackler
histedit: don't crash if the result of fixing up a fold is empty
r17130 |
Pierre-Yves David
test: use a lighter log style in histedit test...
r19014 o 2:888f9082bf99 +5
Augie Fackler
histedit: don't crash if the result of fixing up a fold is empty
r17130 |
Pierre-Yves David
test: use a lighter log style in histedit test...
r19014 o 1:617f94f13c0f +4
Augie Fackler
histedit: don't crash if the result of fixing up a fold is empty
r17130 |
Pierre-Yves David
test: use a lighter log style in histedit test...
r19014 o 0:0189ba417d34 1+2+3
Augie Fackler
histedit: don't crash if the result of fixing up a fold is empty
r17130
Pierre-Yves David
histedit-test: generalise --commands "-" usage...
r19019 $ hg histedit 1 --commands - << EOF
Pierre-Yves David
histedit-test: replace obscure python script by a plain file...
r19016 > pick 617f94f13c0f 1 +4
> drop 888f9082bf99 2 +5
Pierre-Yves David
histedit: properly handle --continue on empty fold...
r19017 > fold 251d831eeec5 3 +6
Augie Fackler
histedit: don't crash if the result of fixing up a fold is empty
r17130 > EOF
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
Pierre-Yves David
histedit: replaces patching logic by merges...
r17647 merging file
Siddharth Agarwal
simplemerge: move conflict warning message to filemerge...
r26614 warning: conflicts while merging file! (edit, then use 'hg resolve --mark')
timeless
histedit: list action when intervention is required
r27629 Fix up the change (fold 251d831eeec5)
(hg histedit --continue to resume)
Augie Fackler
dispatch: exit with status 1 for an InterventionRequired exception (bc)
r18935 [1]
Pierre-Yves David
histedit: replaces patching logic by merges...
r17647 There were conflicts, we keep P1 content. This
Augie Fackler
histedit: don't crash if the result of fixing up a fold is empty
r17130 should effectively drop the changes from +6.
Pulkit Goyal
morestatus: move fb extension to core by plugging to `hg status --verbose`...
r33766
$ hg status -v
Pierre-Yves David
histedit: replaces patching logic by merges...
r17647 M file
? file.orig
Pulkit Goyal
morestatus: move fb extension to core by plugging to `hg status --verbose`...
r33766 # The repository is in an unfinished *histedit* state.
# Unresolved merge conflicts:
#
# file
#
# To mark files as resolved: hg resolve --mark FILE
Pulkit Goyal
morestatus: remove some extra spaces...
r38360 # To continue: hg histedit --continue
# To abort: hg histedit --abort
Pulkit Goyal
morestatus: move fb extension to core by plugging to `hg status --verbose`...
r33766
Pierre-Yves David
histedit: replaces patching logic by merges...
r17647 $ hg resolve -l
U file
$ hg revert -r 'p1()' file
$ hg resolve --mark file
Pierre-Yves David
resolve: add parenthesis around "no more unresolved files" message...
r21947 (no more unresolved files)
timeless
histedit: hook afterresolvedstates
r27627 continue: hg histedit --continue
Augie Fackler
histedit: don't crash if the result of fixing up a fold is empty
r17130 $ hg histedit --continue
Durham Goode
histedit: convert fold/roll actions into a class...
r24771 251d831eeec5: empty changeset
Matt Harbison
tests: remove (glob) annotations that were only for '\' matches...
r35394 saved backup bundle to $TESTTMP/fold-to-empty-test/.hg/strip-backup/888f9082bf99-daa0b8b3-histedit.hg
Pierre-Yves David
test: use a lighter log style in histedit test...
r19014 $ hg logt --graph
@ 1:617f94f13c0f +4
Augie Fackler
histedit: don't crash if the result of fixing up a fold is empty
r17130 |
Pierre-Yves David
test: use a lighter log style in histedit test...
r19014 o 0:0189ba417d34 1+2+3
Augie Fackler
histedit: don't crash if the result of fixing up a fold is empty
r17130
$ cd ..
Patrick Mezard
histedit: fix new nodes computation with --continue (issue3534)...
r17242
Pierre-Yves David
test: improve documentation of some histedit tests...
r19015
Test fold through dropped
-------------------------
Patrick Mezard
histedit: fix new nodes computation with --continue (issue3534)...
r17242 Test corner case where folded revision is separated from its parent by a
dropped revision.
$ hg init fold-with-dropped
$ cd fold-with-dropped
$ printf "1\n2\n3\n" > file
$ hg commit -Am '1+2+3'
adding file
$ echo 4 >> file
$ hg commit -m '+4'
$ echo 5 >> file
$ hg commit -m '+5'
$ echo 6 >> file
$ hg commit -m '+6'
Martin Geisler
test-histedit-fold: remove unnecessary --template...
r19391 $ hg logt -G
Patrick Mezard
histedit: fix new nodes computation with --continue (issue3534)...
r17242 @ 3:251d831eeec5 +6
|
o 2:888f9082bf99 +5
|
o 1:617f94f13c0f +4
|
o 0:0189ba417d34 1+2+3
Pierre-Yves David
histedit-test: generalise --commands "-" usage...
r19019 $ hg histedit 1 --commands - << EOF
Patrick Mezard
histedit: fix new nodes computation with --continue (issue3534)...
r17242 > pick 617f94f13c0f 1 +4
> drop 888f9082bf99 2 +5
> fold 251d831eeec5 3 +6
> EOF
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
Pierre-Yves David
histedit: replaces patching logic by merges...
r17647 merging file
Siddharth Agarwal
simplemerge: move conflict warning message to filemerge...
r26614 warning: conflicts while merging file! (edit, then use 'hg resolve --mark')
timeless
histedit: list action when intervention is required
r27629 Fix up the change (fold 251d831eeec5)
(hg histedit --continue to resume)
Augie Fackler
dispatch: exit with status 1 for an InterventionRequired exception (bc)
r18935 [1]
Pierre-Yves David
histedit: replaces patching logic by merges...
r17647 $ cat > file << EOF
> 1
> 2
> 3
> 4
> 5
> EOF
$ hg resolve --mark file
Pierre-Yves David
resolve: add parenthesis around "no more unresolved files" message...
r21947 (no more unresolved files)
timeless
histedit: hook afterresolvedstates
r27627 continue: hg histedit --continue
Matt Mackall
checkunfinished: accommodate histedit quirk...
r19496 $ hg commit -m '+5.2'
Patrick Mezard
histedit: fix new nodes computation with --continue (issue3534)...
r17242 created new head
$ echo 6 >> file
$ HGEDITOR=cat hg histedit --continue
+4
***
+5.2
***
+6
Pierre-Yves David
histedit: fold in memory...
r17644
HG: Enter commit message. Lines beginning with 'HG:' are removed.
HG: Leave message empty to abort commit.
HG: --
HG: user: test
HG: branch 'default'
HG: changed file
Matt Harbison
tests: remove (glob) annotations that were only for '\' matches...
r35394 saved backup bundle to $TESTTMP/fold-with-dropped/.hg/strip-backup/617f94f13c0f-3d69522c-histedit.hg
Pierre-Yves David
test: use a lighter log style in histedit test...
r19014 $ hg logt -G
@ 1:10c647b2cdd5 +4
Pierre-Yves David
histedit-test: make test-fold more verbose...
r17687 |
Pierre-Yves David
test: use a lighter log style in histedit test...
r19014 o 0:0189ba417d34 1+2+3
Pierre-Yves David
histedit-test: make test-fold more verbose...
r17687
$ hg export tip
# HG changeset patch
# User test
# Date 0 0
Mads Kiilerich
export: show 'Date' header in a format that also is readable for humans...
r18648 # Thu Jan 01 00:00:00 1970 +0000
Pierre-Yves David
histedit: record histedit source (issue3681)...
r18437 # Node ID 10c647b2cdd54db0603ecb99b2ff5ce66d5a5323
Pierre-Yves David
histedit-test: make test-fold more verbose...
r17687 # Parent 0189ba417d34df9dda55f88b637dcae9917b5964
+4
***
+5.2
***
+6
Pierre-Yves David
histedit: record histedit source (issue3681)...
r18437 diff -r 0189ba417d34 -r 10c647b2cdd5 file
Pierre-Yves David
histedit-test: make test-fold more verbose...
r17687 --- a/file Thu Jan 01 00:00:00 1970 +0000
+++ b/file Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +1,6 @@
1
2
3
+4
+5
+6
Patrick Mezard
histedit: fix new nodes computation with --continue (issue3534)...
r17242 $ cd ..
Martin Geisler
histedit: use base for computing renames when folding (issue3729)...
r19392
Folding with initial rename (issue3729)
---------------------------------------
$ hg init fold-rename
$ cd fold-rename
$ echo a > a.txt
$ hg add a.txt
$ hg commit -m a
$ hg rename a.txt b.txt
$ hg commit -m rename
$ echo b >> b.txt
$ hg commit -m b
$ hg logt --follow b.txt
2:e0371e0426bc b
1:1c4f440a8085 rename
0:6c795aa153cb a
$ hg histedit 1c4f440a8085 --commands - 2>&1 << EOF | fixbundle
> pick 1c4f440a8085 rename
> fold e0371e0426bc b
> EOF
$ hg logt --follow b.txt
1:cf858d235c76 rename
0:6c795aa153cb a
$ cd ..
Pierre-Yves David
hook: protect commit hooks against stripping of temporary commit (issue4422)...
r23129
Folding with swapping
---------------------
This is an excuse to test hook with histedit temporary commit (issue4422)
$ hg init issue4422
$ cd issue4422
$ echo a > a.txt
$ hg add a.txt
$ hg commit -m a
$ echo b > b.txt
$ hg add b.txt
$ hg commit -m b
$ echo c > c.txt
$ hg add c.txt
$ hg commit -m c
$ hg logt
2:a1a953ffb4b0 c
1:199b6bb90248 b
0:6c795aa153cb a
Matt Harbison
hook: disable the shell to native command translation by default...
r38745 $ hg histedit 6c795aa153cb --config hooks.commit='echo commit $HG_NODE' --config hooks.tonative.commit=True \
> --commands - 2>&1 << EOF | fixbundle
Pierre-Yves David
hook: protect commit hooks against stripping of temporary commit (issue4422)...
r23129 > pick 199b6bb90248 b
> fold a1a953ffb4b0 c
> pick 6c795aa153cb a
> EOF
commit 9599899f62c05f4377548c32bf1c9f1a39634b0c
$ hg logt
1:9599899f62c0 a
0:79b99e9c8e49 b
Matt Harbison
hooks: allow Unix style environment variables on external Windows hooks...
r38503 Test unix -> windows style variable substitution in external hooks.
$ cat > $TESTTMP/tmp.hgrc <<'EOF'
> [hooks]
> pre-add = echo no variables
> post-add = echo ran $HG_ARGS, literal \$non-var, 'also $non-var', $HG_RESULT
Matt Harbison
hook: disable the shell to native command translation by default...
r38745 > tonative.post-add = True
Matt Harbison
hooks: allow Unix style environment variables on external Windows hooks...
r38503 > EOF
Matt Harbison
largefiles: ensure lfutil.getstandinmatcher() only matches standins...
r26025 $ echo "foo" > amended.txt
Matt Harbison
hooks: allow Unix style environment variables on external Windows hooks...
r38503 $ HGRCPATH=$TESTTMP/tmp.hgrc hg add -v amended.txt
running hook pre-add: echo no variables
no variables
adding amended.txt
Matt Harbison
hook: add support for disabling the shell to native command translation...
r38648 converting hook "post-add" to native (windows !)
Matt Harbison
windows: replace single quote with double quote when translating to cmd.exe...
r38747 running hook post-add: echo ran %HG_ARGS%, literal $non-var, "also $non-var", %HG_RESULT% (windows !)
Matt Harbison
hooks: allow Unix style environment variables on external Windows hooks...
r38503 running hook post-add: echo ran $HG_ARGS, literal \$non-var, 'also $non-var', $HG_RESULT (no-windows !)
Matt Harbison
windows: replace single quote with double quote when translating to cmd.exe...
r38747 ran add -v amended.txt, literal $non-var, "also $non-var", 0 (windows !)
Matt Harbison
hooks: allow Unix style environment variables on external Windows hooks...
r38503 ran add -v amended.txt, literal $non-var, also $non-var, 0 (no-windows !)
Matt Harbison
largefiles: ensure lfutil.getstandinmatcher() only matches standins...
r26025 $ hg ci -q --config extensions.largefiles= --amend -I amended.txt
FUJIWARA Katsunori
tests: add fsmonitor specific output lines at enabling largefiles...
r33209 The fsmonitor extension is incompatible with the largefiles extension and has been disabled. (fsmonitor !)
Matt Harbison
largefiles: ensure lfutil.getstandinmatcher() only matches standins...
r26025
Augie Fackler
histedit: use one editor when multiple folds happen in a row (issue3524) (BC)...
r26246 Test that folding multiple changes in a row doesn't show multiple
editors.
$ echo foo >> foo
$ hg add foo
$ hg ci -m foo1
$ echo foo >> foo
$ hg ci -m foo2
$ echo foo >> foo
$ hg ci -m foo3
$ hg logt
4:21679ff7675c foo3
3:b7389cc4d66e foo2
2:0e01aeef5fa8 foo1
1:578c7455730c a
0:79b99e9c8e49 b
Matt Harbison
test-histedit: $TESTTMP quoting fixes for Windows...
r27062 $ cat > "$TESTTMP/editor.sh" <<EOF
> echo ran editor >> "$TESTTMP/editorlog.txt"
> cat \$1 >> "$TESTTMP/editorlog.txt"
> echo END >> "$TESTTMP/editorlog.txt"
Augie Fackler
histedit: use one editor when multiple folds happen in a row (issue3524) (BC)...
r26246 > echo merged foos > \$1
> EOF
Matt Harbison
test-histedit: $TESTTMP quoting fixes for Windows...
r27062 $ HGEDITOR="sh \"$TESTTMP/editor.sh\"" hg histedit 1 --commands - 2>&1 <<EOF | fixbundle
Augie Fackler
histedit: use one editor when multiple folds happen in a row (issue3524) (BC)...
r26246 > pick 578c7455730c 1 a
> pick 0e01aeef5fa8 2 foo1
> fold b7389cc4d66e 3 foo2
> fold 21679ff7675c 4 foo3
> EOF
$ hg logt
2:e8bedbda72c1 merged foos
1:578c7455730c a
0:79b99e9c8e49 b
Editor should have run only once
$ cat $TESTTMP/editorlog.txt
ran editor
foo1
***
foo2
***
foo3
HG: Enter commit message. Lines beginning with 'HG:' are removed.
HG: Leave message empty to abort commit.
HG: --
HG: user: test
HG: branch 'default'
HG: added foo
END
Pierre-Yves David
hook: protect commit hooks against stripping of temporary commit (issue4422)...
r23129 $ cd ..
André Klitzing
histedit: check first changeset for verb "roll" or "fold" (issue5498)...
r33757
Test rolling into a commit with multiple children (issue5498)
$ hg init roll
$ cd roll
$ echo a > a
$ hg commit -qAm aa
$ echo b > b
$ hg commit -qAm bb
$ hg up -q ".^"
$ echo c > c
$ hg commit -qAm cc
$ hg log -G -T '{node|short} {desc}'
@ 5db65b93a12b cc
|
| o 301d76bdc3ae bb
|/
o 8f0162e483d0 aa
$ hg histedit . --commands - << EOF
> r 5db65b93a12b
> EOF
hg: parse error: first changeset cannot use verb "roll"
[255]
$ hg log -G -T '{node|short} {desc}'
@ 5db65b93a12b cc
|
| o 301d76bdc3ae bb
|/
o 8f0162e483d0 aa