Mercurial > hg
annotate tests/test-mq-qrefresh-replace-log-message.t @ 18510:f254ab6207ae stable
subrepo: use sharepath if available when locating the source repo
This is an alternative fix for issue3518, enabling sharing of repositories with
subrepos, without unconditionally setting the default path in the resulting
repo's hgrc file. Better test coverage is added here, but won't prove this code
is working until fd903f89e42b is backed out.
The problem with the original fix is, if a default path is not available to be
copied over from the share source, the default path on the resulting repo is set
to the source location. Since that's where the actual repository is stored, the
path is essentially self-referential, so push, pull, incoming and outgoing
effectively operate on itself. While incoming and outgoing make it look like
nothing was changed, push currently hangs (see issue3657). In this case where
there is not a real default path, these operations should abort with
"default(-push) not found", like the source repo would. Note this problem with
the original fix affected repos without subrepos too.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Tue, 27 Nov 2012 20:56:27 -0500 |
parents | 113d0a3d050b |
children | 49148d7868df |
rev | line source |
---|---|
17478 | 1 Environment setup for MQ |
2694
0fb28dbf0dc7
MQ: uniformise message and logfile option.
"Mathieu Clabaut <mathieu.clabaut@gmail.com>"
parents:
diff
changeset
|
2 |
12468
d8bf747d2e29
tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents:
5334
diff
changeset
|
3 $ echo "[extensions]" >> $HGRCPATH |
d8bf747d2e29
tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents:
5334
diff
changeset
|
4 $ echo "mq=" >> $HGRCPATH |
d8bf747d2e29
tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents:
5334
diff
changeset
|
5 $ hg init |
d8bf747d2e29
tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents:
5334
diff
changeset
|
6 $ hg qinit |
2694
0fb28dbf0dc7
MQ: uniformise message and logfile option.
"Mathieu Clabaut <mathieu.clabaut@gmail.com>"
parents:
diff
changeset
|
7 |
12468
d8bf747d2e29
tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents:
5334
diff
changeset
|
8 Should fail if no patches applied |
2694
0fb28dbf0dc7
MQ: uniformise message and logfile option.
"Mathieu Clabaut <mathieu.clabaut@gmail.com>"
parents:
diff
changeset
|
9 |
12468
d8bf747d2e29
tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents:
5334
diff
changeset
|
10 $ hg qrefresh |
d8bf747d2e29
tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents:
5334
diff
changeset
|
11 no patches applied |
d8bf747d2e29
tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents:
5334
diff
changeset
|
12 [1] |
d8bf747d2e29
tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents:
5334
diff
changeset
|
13 $ hg qrefresh -e |
d8bf747d2e29
tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents:
5334
diff
changeset
|
14 no patches applied |
d8bf747d2e29
tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents:
5334
diff
changeset
|
15 [1] |
d8bf747d2e29
tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents:
5334
diff
changeset
|
16 $ hg qnew -m "First commit message" first-patch |
d8bf747d2e29
tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents:
5334
diff
changeset
|
17 $ echo aaaa > file |
d8bf747d2e29
tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents:
5334
diff
changeset
|
18 $ hg add file |
d8bf747d2e29
tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents:
5334
diff
changeset
|
19 $ hg qrefresh |
5334
448eb46d4d84
mq: fix qrefresh -e with no patches applied
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4659
diff
changeset
|
20 |
12468
d8bf747d2e29
tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents:
5334
diff
changeset
|
21 Should display 'First commit message' |
d8bf747d2e29
tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents:
5334
diff
changeset
|
22 |
d8bf747d2e29
tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents:
5334
diff
changeset
|
23 $ hg log -l1 --template "{desc}\n" |
d8bf747d2e29
tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents:
5334
diff
changeset
|
24 First commit message |
d8bf747d2e29
tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents:
5334
diff
changeset
|
25 |
d8bf747d2e29
tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents:
5334
diff
changeset
|
26 Testing changing message with -m |
d8bf747d2e29
tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents:
5334
diff
changeset
|
27 |
d8bf747d2e29
tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents:
5334
diff
changeset
|
28 $ echo bbbb > file |
d8bf747d2e29
tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents:
5334
diff
changeset
|
29 $ hg qrefresh -m "Second commit message" |
2694
0fb28dbf0dc7
MQ: uniformise message and logfile option.
"Mathieu Clabaut <mathieu.clabaut@gmail.com>"
parents:
diff
changeset
|
30 |
12468
d8bf747d2e29
tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents:
5334
diff
changeset
|
31 Should display 'Second commit message' |
d8bf747d2e29
tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents:
5334
diff
changeset
|
32 |
d8bf747d2e29
tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents:
5334
diff
changeset
|
33 $ hg log -l1 --template "{desc}\n" |
d8bf747d2e29
tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents:
5334
diff
changeset
|
34 Second commit message |
d8bf747d2e29
tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents:
5334
diff
changeset
|
35 |
d8bf747d2e29
tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents:
5334
diff
changeset
|
36 Testing changing message with -l |
2694
0fb28dbf0dc7
MQ: uniformise message and logfile option.
"Mathieu Clabaut <mathieu.clabaut@gmail.com>"
parents:
diff
changeset
|
37 |
12468
d8bf747d2e29
tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents:
5334
diff
changeset
|
38 $ echo "Third commit message" > logfile |
d8bf747d2e29
tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents:
5334
diff
changeset
|
39 $ echo " This is the 3rd log message" >> logfile |
d8bf747d2e29
tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents:
5334
diff
changeset
|
40 $ echo bbbb > file |
d8bf747d2e29
tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents:
5334
diff
changeset
|
41 $ hg qrefresh -l logfile |
d8bf747d2e29
tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents:
5334
diff
changeset
|
42 |
d8bf747d2e29
tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents:
5334
diff
changeset
|
43 Should display 'Third commit message\\\n This is the 3rd log message' |
2694
0fb28dbf0dc7
MQ: uniformise message and logfile option.
"Mathieu Clabaut <mathieu.clabaut@gmail.com>"
parents:
diff
changeset
|
44 |
12468
d8bf747d2e29
tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents:
5334
diff
changeset
|
45 $ hg log -l1 --template "{desc}\n" |
d8bf747d2e29
tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents:
5334
diff
changeset
|
46 Third commit message |
d8bf747d2e29
tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents:
5334
diff
changeset
|
47 This is the 3rd log message |
d8bf747d2e29
tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents:
5334
diff
changeset
|
48 |
d8bf747d2e29
tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents:
5334
diff
changeset
|
49 Testing changing message with -l- |
2694
0fb28dbf0dc7
MQ: uniformise message and logfile option.
"Mathieu Clabaut <mathieu.clabaut@gmail.com>"
parents:
diff
changeset
|
50 |
12468
d8bf747d2e29
tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents:
5334
diff
changeset
|
51 $ hg qnew -m "First commit message" second-patch |
d8bf747d2e29
tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents:
5334
diff
changeset
|
52 $ echo aaaa > file2 |
d8bf747d2e29
tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents:
5334
diff
changeset
|
53 $ hg add file2 |
d8bf747d2e29
tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents:
5334
diff
changeset
|
54 $ echo bbbb > file2 |
d8bf747d2e29
tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents:
5334
diff
changeset
|
55 $ (echo "Fifth commit message"; echo " This is the 5th log message") | hg qrefresh -l- |
d8bf747d2e29
tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents:
5334
diff
changeset
|
56 |
d8bf747d2e29
tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents:
5334
diff
changeset
|
57 Should display 'Fifth commit message\\\n This is the 5th log message' |
d8bf747d2e29
tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents:
5334
diff
changeset
|
58 |
d8bf747d2e29
tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents:
5334
diff
changeset
|
59 $ hg log -l1 --template "{desc}\n" |
d8bf747d2e29
tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents:
5334
diff
changeset
|
60 Fifth commit message |
d8bf747d2e29
tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents:
5334
diff
changeset
|
61 This is the 5th log message |