annotate tests/test-install.t @ 26631:e077ce385609

localrepo: restore dirstate to one before rollbacking if not parent-gone 'localrepository.rollback()' explicilty restores dirstate, only if at least one of current parents of the working directory is removed at rollbacking (a.k.a "parent-gone"). After DirstateTransactionPlan, 'dirstate.write()' will cause marking '.hg/dirstate' as a file to be restored at rollbacking. https://mercurial.selenic.com/wiki/DirstateTransactionPlan Then, 'transaction.rollback()' restores '.hg/dirstate' regardless of parents of the working directory at that time, and this causes unexpected dirstate changes if not "parent-gone" (e.g. "hg update" to another branch after "hg commit" or so, then "hg rollback"). To avoid such situation, this patch restores dirstate to one before rollbacking if not "parent-gone". before: b1. restore dirstate explicitly, if "parent-gone" after: a1. save dirstate before actual rollbacking via dirstateguard a2. restore dirstate via 'transaction.rollback()' a3. if "parent-gone" - discard backup (a1) - restore dirstate from 'undo.dirstate' a4. otherwise, restore dirstate from backup (a1) Even though restoring dirstate at (a3) after (a2) seems redundant, this patch keeps this existing code path, because: - it isn't ensured that 'dirstate.write()' was invoked at least once while transaction running If not, '.hg/dirstate' isn't restored at (a2). In addition to it, rude 3rd party extension invoking 'dirstate.write()' without 'repo' while transaction running (see subsequent patches for detail) may break consistency of a file backup-ed by transaction. - this patch mainly focuses on changes for DirstateTransactionPlan Restoring dirstate at (a3) itself should be cheaper enough than rollbacking itself. Redundancy will be removed in next step. Newly added test is almost meaningless at this point. It will be used to detect regression while implementing delayed dirstate write out.
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Tue, 13 Oct 2015 12:25:43 -0700
parents be4915009b09
children b1160299a175
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4365
46280c004f22 change tests to use simplemerge by default
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3846
diff changeset
1 hg debuginstall
11917
b03cf2349a80 tests: unify test-install
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 9734
diff changeset
2 $ hg debuginstall
16934
0c9c41e53f1a debuginstall: lowercase status messages
Martin Geisler <mg@aragost.com>
parents: 15447
diff changeset
3 checking encoding (ascii)...
20741
f1dfef0a9352 debuginstall: change showing to checking for consistency and future checking
Matt Mackall <mpm@selenic.com>
parents: 20740
diff changeset
4 checking Python executable (*) (glob)
f1dfef0a9352 debuginstall: change showing to checking for consistency and future checking
Matt Mackall <mpm@selenic.com>
parents: 20740
diff changeset
5 checking Python version (2.*) (glob)
17392
bdd248666dbc debuginstall: show directory for Python lib
Adrian Buehlmann <adrian@cadifra.com>
parents: 16934
diff changeset
6 checking Python lib (*lib*)... (glob)
16934
0c9c41e53f1a debuginstall: lowercase status messages
Martin Geisler <mg@aragost.com>
parents: 15447
diff changeset
7 checking installed modules (*mercurial)... (glob)
0c9c41e53f1a debuginstall: lowercase status messages
Martin Geisler <mg@aragost.com>
parents: 15447
diff changeset
8 checking templates (*mercurial?templates)... (glob)
0c9c41e53f1a debuginstall: lowercase status messages
Martin Geisler <mg@aragost.com>
parents: 15447
diff changeset
9 checking commit editor...
0c9c41e53f1a debuginstall: lowercase status messages
Martin Geisler <mg@aragost.com>
parents: 15447
diff changeset
10 checking username...
0c9c41e53f1a debuginstall: lowercase status messages
Martin Geisler <mg@aragost.com>
parents: 15447
diff changeset
11 no problems detected
9734
36c388a1aa51 commands: call ui.username carefully in debuginstall
Martin Geisler <mg@lazybytes.net>
parents: 4365
diff changeset
12
11917
b03cf2349a80 tests: unify test-install
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 9734
diff changeset
13 hg debuginstall with no username
b03cf2349a80 tests: unify test-install
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 9734
diff changeset
14 $ HGUSER= hg debuginstall
16934
0c9c41e53f1a debuginstall: lowercase status messages
Martin Geisler <mg@aragost.com>
parents: 15447
diff changeset
15 checking encoding (ascii)...
20741
f1dfef0a9352 debuginstall: change showing to checking for consistency and future checking
Matt Mackall <mpm@selenic.com>
parents: 20740
diff changeset
16 checking Python executable (*) (glob)
f1dfef0a9352 debuginstall: change showing to checking for consistency and future checking
Matt Mackall <mpm@selenic.com>
parents: 20740
diff changeset
17 checking Python version (2.*) (glob)
17392
bdd248666dbc debuginstall: show directory for Python lib
Adrian Buehlmann <adrian@cadifra.com>
parents: 16934
diff changeset
18 checking Python lib (*lib*)... (glob)
16934
0c9c41e53f1a debuginstall: lowercase status messages
Martin Geisler <mg@aragost.com>
parents: 15447
diff changeset
19 checking installed modules (*mercurial)... (glob)
0c9c41e53f1a debuginstall: lowercase status messages
Martin Geisler <mg@aragost.com>
parents: 15447
diff changeset
20 checking templates (*mercurial?templates)... (glob)
0c9c41e53f1a debuginstall: lowercase status messages
Martin Geisler <mg@aragost.com>
parents: 15447
diff changeset
21 checking commit editor...
0c9c41e53f1a debuginstall: lowercase status messages
Martin Geisler <mg@aragost.com>
parents: 15447
diff changeset
22 checking username...
20574
5614f8cf0861 ui: suggest config --edit when no username is set
Matt Mackall <mpm@selenic.com>
parents: 17392
diff changeset
23 no username supplied
12084
ff7c1118a83a Merge with stable
Martin Geisler <mg@aragost.com>
parents: 12004
diff changeset
24 (specify a username in your configuration file)
11917
b03cf2349a80 tests: unify test-install
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 9734
diff changeset
25 1 problems detected, please check your install!
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12084
diff changeset
26 [1]
24891
be4915009b09 debuginstall: expand the editor path before searching for it (issue4380)
Matt Harbison <matt_harbison@yahoo.com>
parents: 20741
diff changeset
27
be4915009b09 debuginstall: expand the editor path before searching for it (issue4380)
Matt Harbison <matt_harbison@yahoo.com>
parents: 20741
diff changeset
28 path variables are expanded (~ is the same as $TESTTMP)
be4915009b09 debuginstall: expand the editor path before searching for it (issue4380)
Matt Harbison <matt_harbison@yahoo.com>
parents: 20741
diff changeset
29 $ mkdir tools
be4915009b09 debuginstall: expand the editor path before searching for it (issue4380)
Matt Harbison <matt_harbison@yahoo.com>
parents: 20741
diff changeset
30 $ touch tools/testeditor.exe
be4915009b09 debuginstall: expand the editor path before searching for it (issue4380)
Matt Harbison <matt_harbison@yahoo.com>
parents: 20741
diff changeset
31 #if execbit
be4915009b09 debuginstall: expand the editor path before searching for it (issue4380)
Matt Harbison <matt_harbison@yahoo.com>
parents: 20741
diff changeset
32 $ chmod 755 tools/testeditor.exe
be4915009b09 debuginstall: expand the editor path before searching for it (issue4380)
Matt Harbison <matt_harbison@yahoo.com>
parents: 20741
diff changeset
33 #endif
be4915009b09 debuginstall: expand the editor path before searching for it (issue4380)
Matt Harbison <matt_harbison@yahoo.com>
parents: 20741
diff changeset
34 $ hg debuginstall --config ui.editor=~/tools/testeditor.exe
be4915009b09 debuginstall: expand the editor path before searching for it (issue4380)
Matt Harbison <matt_harbison@yahoo.com>
parents: 20741
diff changeset
35 checking encoding (ascii)...
be4915009b09 debuginstall: expand the editor path before searching for it (issue4380)
Matt Harbison <matt_harbison@yahoo.com>
parents: 20741
diff changeset
36 checking Python executable (*) (glob)
be4915009b09 debuginstall: expand the editor path before searching for it (issue4380)
Matt Harbison <matt_harbison@yahoo.com>
parents: 20741
diff changeset
37 checking Python version (*) (glob)
be4915009b09 debuginstall: expand the editor path before searching for it (issue4380)
Matt Harbison <matt_harbison@yahoo.com>
parents: 20741
diff changeset
38 checking Python lib (*lib*)... (glob)
be4915009b09 debuginstall: expand the editor path before searching for it (issue4380)
Matt Harbison <matt_harbison@yahoo.com>
parents: 20741
diff changeset
39 checking installed modules (*mercurial)... (glob)
be4915009b09 debuginstall: expand the editor path before searching for it (issue4380)
Matt Harbison <matt_harbison@yahoo.com>
parents: 20741
diff changeset
40 checking templates (*mercurial?templates)... (glob)
be4915009b09 debuginstall: expand the editor path before searching for it (issue4380)
Matt Harbison <matt_harbison@yahoo.com>
parents: 20741
diff changeset
41 checking commit editor...
be4915009b09 debuginstall: expand the editor path before searching for it (issue4380)
Matt Harbison <matt_harbison@yahoo.com>
parents: 20741
diff changeset
42 checking username...
be4915009b09 debuginstall: expand the editor path before searching for it (issue4380)
Matt Harbison <matt_harbison@yahoo.com>
parents: 20741
diff changeset
43 no problems detected