Mercurial > hg
annotate tests/test-subrepo-git.t @ 34986:828cf35f1de6 stable
subrepo: extend config option to disable subrepos by type (SEC)
This allows us to minimize the behavior change introduced by the next patch.
I have no idea which config style is preferred in UX POV, but I decided to
get things done.
a) list: 'allowed = hg, git, svn'
b) sub option: 'allowed.hg = True' or 'allowed:hg = True'
c) per-type action: 'hg = allow', 'git = abort'
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 05 Nov 2017 21:48:58 +0900 |
parents | 5e27afeddaee |
children | 846942fd6d15 |
rev | line source |
---|---|
22046
7a9cbb315d84
tests: replace exit 80 with #require
Matt Mackall <mpm@selenic.com>
parents:
21751
diff
changeset
|
1 #require git |
12992
2b73a3279a9f
subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff
changeset
|
2 |
2b73a3279a9f
subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff
changeset
|
3 make git commits repeatable |
2b73a3279a9f
subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff
changeset
|
4 |
32413
d6be5b5cc325
test: prepare tests for removing date aliases
Boris Feld <boris.feld@octobus.net>
parents:
30062
diff
changeset
|
5 $ cat >> $HGRCPATH <<EOF |
d6be5b5cc325
test: prepare tests for removing date aliases
Boris Feld <boris.feld@octobus.net>
parents:
30062
diff
changeset
|
6 > [defaults] |
d6be5b5cc325
test: prepare tests for removing date aliases
Boris Feld <boris.feld@octobus.net>
parents:
30062
diff
changeset
|
7 > commit = -d "0 0" |
d6be5b5cc325
test: prepare tests for removing date aliases
Boris Feld <boris.feld@octobus.net>
parents:
30062
diff
changeset
|
8 > EOF |
d6be5b5cc325
test: prepare tests for removing date aliases
Boris Feld <boris.feld@octobus.net>
parents:
30062
diff
changeset
|
9 |
17022
8a38839ae1dc
test-subrepo-git.t: adapt for Windows
Eduard-Cristian Stefan <alexandrul.ct@gmail.com>
parents:
16913
diff
changeset
|
10 $ echo "[core]" >> $HOME/.gitconfig |
8a38839ae1dc
test-subrepo-git.t: adapt for Windows
Eduard-Cristian Stefan <alexandrul.ct@gmail.com>
parents:
16913
diff
changeset
|
11 $ echo "autocrlf = false" >> $HOME/.gitconfig |
12992
2b73a3279a9f
subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff
changeset
|
12 $ GIT_AUTHOR_NAME='test'; export GIT_AUTHOR_NAME |
2b73a3279a9f
subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff
changeset
|
13 $ GIT_AUTHOR_EMAIL='test@example.org'; export GIT_AUTHOR_EMAIL |
2b73a3279a9f
subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff
changeset
|
14 $ GIT_AUTHOR_DATE='1234567891 +0000'; export GIT_AUTHOR_DATE |
2b73a3279a9f
subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff
changeset
|
15 $ GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME"; export GIT_COMMITTER_NAME |
2b73a3279a9f
subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff
changeset
|
16 $ GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL"; export GIT_COMMITTER_EMAIL |
2b73a3279a9f
subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff
changeset
|
17 $ GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"; export GIT_COMMITTER_DATE |
23693
9a02f7517939
test-subrepo-git: ignore global git config
Matt Mackall <mpm@selenic.com>
parents:
23678
diff
changeset
|
18 $ GIT_CONFIG_NOSYSTEM=1; export GIT_CONFIG_NOSYSTEM |
12992
2b73a3279a9f
subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff
changeset
|
19 |
2b73a3279a9f
subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff
changeset
|
20 root hg repo |
2b73a3279a9f
subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff
changeset
|
21 |
2b73a3279a9f
subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff
changeset
|
22 $ hg init t |
2b73a3279a9f
subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff
changeset
|
23 $ cd t |
2b73a3279a9f
subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff
changeset
|
24 $ echo a > a |
2b73a3279a9f
subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff
changeset
|
25 $ hg add a |
2b73a3279a9f
subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff
changeset
|
26 $ hg commit -m a |
2b73a3279a9f
subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff
changeset
|
27 $ cd .. |
2b73a3279a9f
subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff
changeset
|
28 |
2b73a3279a9f
subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff
changeset
|
29 new external git repo |
2b73a3279a9f
subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff
changeset
|
30 |
2b73a3279a9f
subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff
changeset
|
31 $ mkdir gitroot |
2b73a3279a9f
subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff
changeset
|
32 $ cd gitroot |
2b73a3279a9f
subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff
changeset
|
33 $ git init -q |
2b73a3279a9f
subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff
changeset
|
34 $ echo g > g |
2b73a3279a9f
subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff
changeset
|
35 $ git add g |
2b73a3279a9f
subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff
changeset
|
36 $ git commit -q -m g |
2b73a3279a9f
subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff
changeset
|
37 |
2b73a3279a9f
subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff
changeset
|
38 add subrepo clone |
2b73a3279a9f
subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff
changeset
|
39 |
2b73a3279a9f
subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff
changeset
|
40 $ cd ../t |
2b73a3279a9f
subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff
changeset
|
41 $ echo 's = [git]../gitroot' > .hgsub |
2b73a3279a9f
subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff
changeset
|
42 $ git clone -q ../gitroot s |
2b73a3279a9f
subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff
changeset
|
43 $ hg add .hgsub |
2b73a3279a9f
subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff
changeset
|
44 $ hg commit -m 'new git subrepo' |
2b73a3279a9f
subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff
changeset
|
45 $ hg debugsub |
2b73a3279a9f
subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff
changeset
|
46 path s |
2b73a3279a9f
subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff
changeset
|
47 source ../gitroot |
2b73a3279a9f
subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff
changeset
|
48 revision da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7 |
2b73a3279a9f
subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff
changeset
|
49 |
12995
d90fc91c8377
subrepo: update and merge works with any git branch
Eric Eisner <ede@mit.edu>
parents:
12994
diff
changeset
|
50 record a new commit from upstream from a different branch |
12992
2b73a3279a9f
subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff
changeset
|
51 |
2b73a3279a9f
subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff
changeset
|
52 $ cd ../gitroot |
13091
8cecea387574
test-subrepo-git.t: silence git output
Eric Eisner <ede@mit.edu>
parents:
13087
diff
changeset
|
53 $ git checkout -q -b testing |
12992
2b73a3279a9f
subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff
changeset
|
54 $ echo gg >> g |
2b73a3279a9f
subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff
changeset
|
55 $ git commit -q -a -m gg |
2b73a3279a9f
subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff
changeset
|
56 |
2b73a3279a9f
subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff
changeset
|
57 $ cd ../t/s |
13091
8cecea387574
test-subrepo-git.t: silence git output
Eric Eisner <ede@mit.edu>
parents:
13087
diff
changeset
|
58 $ git pull -q >/dev/null 2>/dev/null |
8cecea387574
test-subrepo-git.t: silence git output
Eric Eisner <ede@mit.edu>
parents:
13087
diff
changeset
|
59 $ git checkout -q -b testing origin/testing >/dev/null |
12992
2b73a3279a9f
subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff
changeset
|
60 |
2b73a3279a9f
subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff
changeset
|
61 $ cd .. |
13182
2537bd17421d
subrepo: basic support for status of git subrepos
Eric Eisner <ede@mit.edu>
parents:
13181
diff
changeset
|
62 $ hg status --subrepos |
2537bd17421d
subrepo: basic support for status of git subrepos
Eric Eisner <ede@mit.edu>
parents:
13181
diff
changeset
|
63 M s/g |
12992
2b73a3279a9f
subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff
changeset
|
64 $ hg commit -m 'update git subrepo' |
2b73a3279a9f
subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff
changeset
|
65 $ hg debugsub |
2b73a3279a9f
subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff
changeset
|
66 path s |
2b73a3279a9f
subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff
changeset
|
67 source ../gitroot |
2b73a3279a9f
subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff
changeset
|
68 revision 126f2a14290cd5ce061fdedc430170e8d39e1c5a |
12993
a91334380699
subrepo: cloning and updating of git subrepos
Eric Eisner <ede@mit.edu>
parents:
12992
diff
changeset
|
69 |
13092
83986af605e5
test-subrepo-git.t: make gitroot pushable earlier
Eric Eisner <ede@mit.edu>
parents:
13091
diff
changeset
|
70 make $GITROOT pushable, by replacing it with a clone with nothing checked out |
83986af605e5
test-subrepo-git.t: make gitroot pushable earlier
Eric Eisner <ede@mit.edu>
parents:
13091
diff
changeset
|
71 |
83986af605e5
test-subrepo-git.t: make gitroot pushable earlier
Eric Eisner <ede@mit.edu>
parents:
13091
diff
changeset
|
72 $ cd .. |
83986af605e5
test-subrepo-git.t: make gitroot pushable earlier
Eric Eisner <ede@mit.edu>
parents:
13091
diff
changeset
|
73 $ git clone gitroot gitrootbare --bare -q |
83986af605e5
test-subrepo-git.t: make gitroot pushable earlier
Eric Eisner <ede@mit.edu>
parents:
13091
diff
changeset
|
74 $ rm -rf gitroot |
83986af605e5
test-subrepo-git.t: make gitroot pushable earlier
Eric Eisner <ede@mit.edu>
parents:
13091
diff
changeset
|
75 $ mv gitrootbare gitroot |
83986af605e5
test-subrepo-git.t: make gitroot pushable earlier
Eric Eisner <ede@mit.edu>
parents:
13091
diff
changeset
|
76 |
12993
a91334380699
subrepo: cloning and updating of git subrepos
Eric Eisner <ede@mit.edu>
parents:
12992
diff
changeset
|
77 clone root |
a91334380699
subrepo: cloning and updating of git subrepos
Eric Eisner <ede@mit.edu>
parents:
12992
diff
changeset
|
78 |
13092
83986af605e5
test-subrepo-git.t: make gitroot pushable earlier
Eric Eisner <ede@mit.edu>
parents:
13091
diff
changeset
|
79 $ cd t |
20105
c5a0f899e47b
tests: deal with new gits sending status messages to stderr
Mads Kiilerich <madski@unity3d.com>
parents:
19811
diff
changeset
|
80 $ hg clone . ../tc 2> /dev/null |
12993
a91334380699
subrepo: cloning and updating of git subrepos
Eric Eisner <ede@mit.edu>
parents:
12992
diff
changeset
|
81 updating to branch default |
13525
c12088259f64
subrepo: show the source that git clones
Eric Eisner <ede@mit.edu>
parents:
13460
diff
changeset
|
82 cloning subrepo s from $TESTTMP/gitroot |
12993
a91334380699
subrepo: cloning and updating of git subrepos
Eric Eisner <ede@mit.edu>
parents:
12992
diff
changeset
|
83 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
a91334380699
subrepo: cloning and updating of git subrepos
Eric Eisner <ede@mit.edu>
parents:
12992
diff
changeset
|
84 $ cd ../tc |
a91334380699
subrepo: cloning and updating of git subrepos
Eric Eisner <ede@mit.edu>
parents:
12992
diff
changeset
|
85 $ hg debugsub |
a91334380699
subrepo: cloning and updating of git subrepos
Eric Eisner <ede@mit.edu>
parents:
12992
diff
changeset
|
86 path s |
a91334380699
subrepo: cloning and updating of git subrepos
Eric Eisner <ede@mit.edu>
parents:
12992
diff
changeset
|
87 source ../gitroot |
a91334380699
subrepo: cloning and updating of git subrepos
Eric Eisner <ede@mit.edu>
parents:
12992
diff
changeset
|
88 revision 126f2a14290cd5ce061fdedc430170e8d39e1c5a |
34985
5e27afeddaee
subrepo: add config option to reject any subrepo operations (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
34984
diff
changeset
|
89 $ cd .. |
5e27afeddaee
subrepo: add config option to reject any subrepo operations (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
34984
diff
changeset
|
90 |
5e27afeddaee
subrepo: add config option to reject any subrepo operations (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
34984
diff
changeset
|
91 clone with subrepo disabled (update should fail) |
5e27afeddaee
subrepo: add config option to reject any subrepo operations (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
34984
diff
changeset
|
92 |
34986
828cf35f1de6
subrepo: extend config option to disable subrepos by type (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
34985
diff
changeset
|
93 $ hg clone t -U tc2 --config subrepos.allowed= |
828cf35f1de6
subrepo: extend config option to disable subrepos by type (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
34985
diff
changeset
|
94 $ hg update -R tc2 --config subrepos.allowed= |
828cf35f1de6
subrepo: extend config option to disable subrepos by type (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
34985
diff
changeset
|
95 abort: subrepo type git not allowed |
34985
5e27afeddaee
subrepo: add config option to reject any subrepo operations (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
34984
diff
changeset
|
96 (see 'hg help config.subrepos' for details) |
5e27afeddaee
subrepo: add config option to reject any subrepo operations (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
34984
diff
changeset
|
97 [255] |
5e27afeddaee
subrepo: add config option to reject any subrepo operations (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
34984
diff
changeset
|
98 $ ls tc2 |
5e27afeddaee
subrepo: add config option to reject any subrepo operations (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
34984
diff
changeset
|
99 a |
5e27afeddaee
subrepo: add config option to reject any subrepo operations (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
34984
diff
changeset
|
100 |
34986
828cf35f1de6
subrepo: extend config option to disable subrepos by type (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
34985
diff
changeset
|
101 $ hg clone t tc3 --config subrepos.allowed= |
34985
5e27afeddaee
subrepo: add config option to reject any subrepo operations (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
34984
diff
changeset
|
102 updating to branch default |
34986
828cf35f1de6
subrepo: extend config option to disable subrepos by type (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
34985
diff
changeset
|
103 abort: subrepo type git not allowed |
34985
5e27afeddaee
subrepo: add config option to reject any subrepo operations (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
34984
diff
changeset
|
104 (see 'hg help config.subrepos' for details) |
5e27afeddaee
subrepo: add config option to reject any subrepo operations (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
34984
diff
changeset
|
105 [255] |
5e27afeddaee
subrepo: add config option to reject any subrepo operations (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
34984
diff
changeset
|
106 $ ls tc3 |
5e27afeddaee
subrepo: add config option to reject any subrepo operations (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
34984
diff
changeset
|
107 a |
12993
a91334380699
subrepo: cloning and updating of git subrepos
Eric Eisner <ede@mit.edu>
parents:
12992
diff
changeset
|
108 |
34986
828cf35f1de6
subrepo: extend config option to disable subrepos by type (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
34985
diff
changeset
|
109 $ hg clone t tc4 --config subrepos.allowed=hg |
828cf35f1de6
subrepo: extend config option to disable subrepos by type (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
34985
diff
changeset
|
110 updating to branch default |
828cf35f1de6
subrepo: extend config option to disable subrepos by type (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
34985
diff
changeset
|
111 abort: subrepo type git not allowed |
828cf35f1de6
subrepo: extend config option to disable subrepos by type (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
34985
diff
changeset
|
112 (see 'hg help config.subrepos' for details) |
828cf35f1de6
subrepo: extend config option to disable subrepos by type (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
34985
diff
changeset
|
113 [255] |
828cf35f1de6
subrepo: extend config option to disable subrepos by type (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
34985
diff
changeset
|
114 $ ls tc4 |
828cf35f1de6
subrepo: extend config option to disable subrepos by type (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
34985
diff
changeset
|
115 a |
828cf35f1de6
subrepo: extend config option to disable subrepos by type (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
34985
diff
changeset
|
116 |
12993
a91334380699
subrepo: cloning and updating of git subrepos
Eric Eisner <ede@mit.edu>
parents:
12992
diff
changeset
|
117 update to previous substate |
a91334380699
subrepo: cloning and updating of git subrepos
Eric Eisner <ede@mit.edu>
parents:
12992
diff
changeset
|
118 |
34985
5e27afeddaee
subrepo: add config option to reject any subrepo operations (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
34984
diff
changeset
|
119 $ cd tc |
13111
560b8001f765
subrepo: silence git output when ui.quiet is set
Eric Eisner <ede@mit.edu>
parents:
13092
diff
changeset
|
120 $ hg update 1 -q |
12993
a91334380699
subrepo: cloning and updating of git subrepos
Eric Eisner <ede@mit.edu>
parents:
12992
diff
changeset
|
121 $ cat s/g |
a91334380699
subrepo: cloning and updating of git subrepos
Eric Eisner <ede@mit.edu>
parents:
12992
diff
changeset
|
122 g |
a91334380699
subrepo: cloning and updating of git subrepos
Eric Eisner <ede@mit.edu>
parents:
12992
diff
changeset
|
123 $ hg debugsub |
a91334380699
subrepo: cloning and updating of git subrepos
Eric Eisner <ede@mit.edu>
parents:
12992
diff
changeset
|
124 path s |
a91334380699
subrepo: cloning and updating of git subrepos
Eric Eisner <ede@mit.edu>
parents:
12992
diff
changeset
|
125 source ../gitroot |
a91334380699
subrepo: cloning and updating of git subrepos
Eric Eisner <ede@mit.edu>
parents:
12992
diff
changeset
|
126 revision da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7 |
12994
845c602b8635
subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents:
12993
diff
changeset
|
127 |
845c602b8635
subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents:
12993
diff
changeset
|
128 clone root, make local change |
845c602b8635
subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents:
12993
diff
changeset
|
129 |
13092
83986af605e5
test-subrepo-git.t: make gitroot pushable earlier
Eric Eisner <ede@mit.edu>
parents:
13091
diff
changeset
|
130 $ cd ../t |
20105
c5a0f899e47b
tests: deal with new gits sending status messages to stderr
Mads Kiilerich <madski@unity3d.com>
parents:
19811
diff
changeset
|
131 $ hg clone . ../ta 2> /dev/null |
12994
845c602b8635
subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents:
12993
diff
changeset
|
132 updating to branch default |
13525
c12088259f64
subrepo: show the source that git clones
Eric Eisner <ede@mit.edu>
parents:
13460
diff
changeset
|
133 cloning subrepo s from $TESTTMP/gitroot |
12994
845c602b8635
subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents:
12993
diff
changeset
|
134 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
845c602b8635
subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents:
12993
diff
changeset
|
135 |
845c602b8635
subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents:
12993
diff
changeset
|
136 $ cd ../ta |
845c602b8635
subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents:
12993
diff
changeset
|
137 $ echo ggg >> s/g |
13182
2537bd17421d
subrepo: basic support for status of git subrepos
Eric Eisner <ede@mit.edu>
parents:
13181
diff
changeset
|
138 $ hg status --subrepos |
2537bd17421d
subrepo: basic support for status of git subrepos
Eric Eisner <ede@mit.edu>
parents:
13181
diff
changeset
|
139 M s/g |
23523
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
140 $ hg diff --subrepos |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
141 diff --git a/s/g b/s/g |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
142 index 089258f..85341ee 100644 |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
143 --- a/s/g |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
144 +++ b/s/g |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
145 @@ -1,2 +1,3 @@ |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
146 g |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
147 gg |
23938
de519517f597
subrepo: correctly add newline for git subrepo diffs
Mathias De Maré <mathias.demare@gmail.com>
parents:
23937
diff
changeset
|
148 +ggg |
15321
e174353e8cda
subrepos: abort commit by default if a subrepo is dirty (BC)
Martin Geisler <mg@lazybytes.net>
parents:
14481
diff
changeset
|
149 $ hg commit --subrepos -m ggg |
13181
413bef846806
subrepo: fix subrelpath for git subrepos
Eric Eisner <ede@mit.edu>
parents:
13111
diff
changeset
|
150 committing subrepository s |
12994
845c602b8635
subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents:
12993
diff
changeset
|
151 $ hg debugsub |
845c602b8635
subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents:
12993
diff
changeset
|
152 path s |
845c602b8635
subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents:
12993
diff
changeset
|
153 source ../gitroot |
845c602b8635
subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents:
12993
diff
changeset
|
154 revision 79695940086840c99328513acbe35f90fcd55e57 |
845c602b8635
subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents:
12993
diff
changeset
|
155 |
845c602b8635
subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents:
12993
diff
changeset
|
156 clone root separately, make different local change |
845c602b8635
subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents:
12993
diff
changeset
|
157 |
845c602b8635
subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents:
12993
diff
changeset
|
158 $ cd ../t |
20105
c5a0f899e47b
tests: deal with new gits sending status messages to stderr
Mads Kiilerich <madski@unity3d.com>
parents:
19811
diff
changeset
|
159 $ hg clone . ../tb 2> /dev/null |
12994
845c602b8635
subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents:
12993
diff
changeset
|
160 updating to branch default |
13525
c12088259f64
subrepo: show the source that git clones
Eric Eisner <ede@mit.edu>
parents:
13460
diff
changeset
|
161 cloning subrepo s from $TESTTMP/gitroot |
12994
845c602b8635
subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents:
12993
diff
changeset
|
162 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
845c602b8635
subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents:
12993
diff
changeset
|
163 |
845c602b8635
subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents:
12993
diff
changeset
|
164 $ cd ../tb/s |
23411
2d86f4e38c08
subrepo: add status support for ignored files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
22590
diff
changeset
|
165 $ hg status --subrepos |
12994
845c602b8635
subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents:
12993
diff
changeset
|
166 $ echo f > f |
23411
2d86f4e38c08
subrepo: add status support for ignored files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
22590
diff
changeset
|
167 $ hg status --subrepos |
2d86f4e38c08
subrepo: add status support for ignored files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
22590
diff
changeset
|
168 ? s/f |
23963
8f02682ff3b0
subrepo: don't abort in add when non-hg subrepos are present (issue4513)
Matt Harbison <matt_harbison@yahoo.com>
parents:
23938
diff
changeset
|
169 $ hg add . |
24174
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
170 adding f |
12994
845c602b8635
subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents:
12993
diff
changeset
|
171 $ git add f |
845c602b8635
subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents:
12993
diff
changeset
|
172 $ cd .. |
845c602b8635
subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents:
12993
diff
changeset
|
173 |
13182
2537bd17421d
subrepo: basic support for status of git subrepos
Eric Eisner <ede@mit.edu>
parents:
13181
diff
changeset
|
174 $ hg status --subrepos |
2537bd17421d
subrepo: basic support for status of git subrepos
Eric Eisner <ede@mit.edu>
parents:
13181
diff
changeset
|
175 A s/f |
15321
e174353e8cda
subrepos: abort commit by default if a subrepo is dirty (BC)
Martin Geisler <mg@lazybytes.net>
parents:
14481
diff
changeset
|
176 $ hg commit --subrepos -m f |
13181
413bef846806
subrepo: fix subrelpath for git subrepos
Eric Eisner <ede@mit.edu>
parents:
13111
diff
changeset
|
177 committing subrepository s |
12994
845c602b8635
subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents:
12993
diff
changeset
|
178 $ hg debugsub |
845c602b8635
subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents:
12993
diff
changeset
|
179 path s |
845c602b8635
subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents:
12993
diff
changeset
|
180 source ../gitroot |
845c602b8635
subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents:
12993
diff
changeset
|
181 revision aa84837ccfbdfedcdcdeeedc309d73e6eb069edc |
845c602b8635
subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents:
12993
diff
changeset
|
182 |
845c602b8635
subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents:
12993
diff
changeset
|
183 user b push changes |
845c602b8635
subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents:
12993
diff
changeset
|
184 |
13091
8cecea387574
test-subrepo-git.t: silence git output
Eric Eisner <ede@mit.edu>
parents:
13087
diff
changeset
|
185 $ hg push 2>/dev/null |
17022
8a38839ae1dc
test-subrepo-git.t: adapt for Windows
Eduard-Cristian Stefan <alexandrul.ct@gmail.com>
parents:
16913
diff
changeset
|
186 pushing to $TESTTMP/t (glob) |
33365
6d88468d435b
subrepo: make the output references to subrepositories consistent
Matt Harbison <matt_harbison@yahoo.com>
parents:
32902
diff
changeset
|
187 pushing branch testing of subrepository "s" |
12994
845c602b8635
subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents:
12993
diff
changeset
|
188 searching for changes |
845c602b8635
subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents:
12993
diff
changeset
|
189 adding changesets |
845c602b8635
subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents:
12993
diff
changeset
|
190 adding manifests |
845c602b8635
subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents:
12993
diff
changeset
|
191 adding file changes |
845c602b8635
subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents:
12993
diff
changeset
|
192 added 1 changesets with 1 changes to 1 files |
845c602b8635
subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents:
12993
diff
changeset
|
193 |
845c602b8635
subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents:
12993
diff
changeset
|
194 user a pulls, merges, commits |
845c602b8635
subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents:
12993
diff
changeset
|
195 |
845c602b8635
subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents:
12993
diff
changeset
|
196 $ cd ../ta |
845c602b8635
subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents:
12993
diff
changeset
|
197 $ hg pull |
17022
8a38839ae1dc
test-subrepo-git.t: adapt for Windows
Eduard-Cristian Stefan <alexandrul.ct@gmail.com>
parents:
16913
diff
changeset
|
198 pulling from $TESTTMP/t (glob) |
12994
845c602b8635
subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents:
12993
diff
changeset
|
199 searching for changes |
845c602b8635
subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents:
12993
diff
changeset
|
200 adding changesets |
845c602b8635
subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents:
12993
diff
changeset
|
201 adding manifests |
845c602b8635
subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents:
12993
diff
changeset
|
202 adding file changes |
845c602b8635
subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents:
12993
diff
changeset
|
203 added 1 changesets with 1 changes to 1 files (+1 heads) |
34661
eb586ed5d8ce
transaction-summary: show the range of new revisions upon pull/unbundle (BC)
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
34146
diff
changeset
|
204 new changesets 089416c11d73 |
12994
845c602b8635
subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents:
12993
diff
changeset
|
205 (run 'hg heads' to see heads, 'hg merge' to merge) |
13091
8cecea387574
test-subrepo-git.t: silence git output
Eric Eisner <ede@mit.edu>
parents:
13087
diff
changeset
|
206 $ hg merge 2>/dev/null |
21401
2c364f7801c8
subrepo: use subrepo shortid method to generate subrepo diverged promptchoice
Angel Ezquerra <angel.ezquerra@gmail.com>
parents:
21024
diff
changeset
|
207 subrepository s diverged (local revision: 7969594, remote revision: aa84837) |
30062
940c05b25b07
merge: add conflict labels to merge command
Simon Farnsworth <simonfar@fb.com>
parents:
30060
diff
changeset
|
208 (M)erge, keep (l)ocal [working copy] or keep (r)emote [merge rev]? m |
13569
3ab3b892d223
subrepo: show the source that git pulls
Eric Eisner <ede@mit.edu>
parents:
13560
diff
changeset
|
209 pulling subrepo s from $TESTTMP/gitroot |
12994
845c602b8635
subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents:
12993
diff
changeset
|
210 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
845c602b8635
subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents:
12993
diff
changeset
|
211 (branch merge, don't forget to commit) |
24256
e964edc3274e
subrepo: add status support for ignored and clean files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24183
diff
changeset
|
212 $ hg st --subrepos s |
e964edc3274e
subrepo: add status support for ignored and clean files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24183
diff
changeset
|
213 A s/f |
12994
845c602b8635
subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents:
12993
diff
changeset
|
214 $ cat s/f |
845c602b8635
subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents:
12993
diff
changeset
|
215 f |
845c602b8635
subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents:
12993
diff
changeset
|
216 $ cat s/g |
845c602b8635
subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents:
12993
diff
changeset
|
217 g |
845c602b8635
subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents:
12993
diff
changeset
|
218 gg |
845c602b8635
subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents:
12993
diff
changeset
|
219 ggg |
15321
e174353e8cda
subrepos: abort commit by default if a subrepo is dirty (BC)
Martin Geisler <mg@lazybytes.net>
parents:
14481
diff
changeset
|
220 $ hg commit --subrepos -m 'merge' |
13181
413bef846806
subrepo: fix subrelpath for git subrepos
Eric Eisner <ede@mit.edu>
parents:
13111
diff
changeset
|
221 committing subrepository s |
13182
2537bd17421d
subrepo: basic support for status of git subrepos
Eric Eisner <ede@mit.edu>
parents:
13181
diff
changeset
|
222 $ hg status --subrepos --rev 1:5 |
2537bd17421d
subrepo: basic support for status of git subrepos
Eric Eisner <ede@mit.edu>
parents:
13181
diff
changeset
|
223 M .hgsubstate |
2537bd17421d
subrepo: basic support for status of git subrepos
Eric Eisner <ede@mit.edu>
parents:
13181
diff
changeset
|
224 M s/g |
2537bd17421d
subrepo: basic support for status of git subrepos
Eric Eisner <ede@mit.edu>
parents:
13181
diff
changeset
|
225 A s/f |
12994
845c602b8635
subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents:
12993
diff
changeset
|
226 $ hg debugsub |
845c602b8635
subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents:
12993
diff
changeset
|
227 path s |
845c602b8635
subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents:
12993
diff
changeset
|
228 source ../gitroot |
845c602b8635
subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents:
12993
diff
changeset
|
229 revision f47b465e1bce645dbf37232a00574aa1546ca8d3 |
13091
8cecea387574
test-subrepo-git.t: silence git output
Eric Eisner <ede@mit.edu>
parents:
13087
diff
changeset
|
230 $ hg push 2>/dev/null |
17022
8a38839ae1dc
test-subrepo-git.t: adapt for Windows
Eduard-Cristian Stefan <alexandrul.ct@gmail.com>
parents:
16913
diff
changeset
|
231 pushing to $TESTTMP/t (glob) |
33365
6d88468d435b
subrepo: make the output references to subrepositories consistent
Matt Harbison <matt_harbison@yahoo.com>
parents:
32902
diff
changeset
|
232 pushing branch testing of subrepository "s" |
12994
845c602b8635
subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents:
12993
diff
changeset
|
233 searching for changes |
845c602b8635
subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents:
12993
diff
changeset
|
234 adding changesets |
845c602b8635
subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents:
12993
diff
changeset
|
235 adding manifests |
845c602b8635
subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents:
12993
diff
changeset
|
236 adding file changes |
845c602b8635
subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents:
12993
diff
changeset
|
237 added 2 changesets with 2 changes to 1 files |
12996
3a42651b0a62
subrepo: removing (and restoring) git subrepo state
Eric Eisner <ede@mit.edu>
parents:
12995
diff
changeset
|
238 |
13029 | 239 make upstream git changes |
240 | |
241 $ cd .. | |
242 $ git clone -q gitroot gitclone | |
243 $ cd gitclone | |
244 $ echo ff >> f | |
245 $ git commit -q -a -m ff | |
246 $ echo fff >> f | |
247 $ git commit -q -a -m fff | |
13091
8cecea387574
test-subrepo-git.t: silence git output
Eric Eisner <ede@mit.edu>
parents:
13087
diff
changeset
|
248 $ git push origin testing 2>/dev/null |
13029 | 249 |
250 make and push changes to hg without updating the subrepo | |
251 | |
252 $ cd ../t | |
20105
c5a0f899e47b
tests: deal with new gits sending status messages to stderr
Mads Kiilerich <madski@unity3d.com>
parents:
19811
diff
changeset
|
253 $ hg clone . ../td 2>&1 | egrep -v '^Cloning into|^done\.' |
13029 | 254 updating to branch default |
13525
c12088259f64
subrepo: show the source that git clones
Eric Eisner <ede@mit.edu>
parents:
13460
diff
changeset
|
255 cloning subrepo s from $TESTTMP/gitroot |
33365
6d88468d435b
subrepo: make the output references to subrepositories consistent
Matt Harbison <matt_harbison@yahoo.com>
parents:
32902
diff
changeset
|
256 checking out detached HEAD in subrepository "s" |
13029 | 257 check out a git branch if you intend to make changes |
258 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
259 $ cd ../td | |
260 $ echo aa >> a | |
261 $ hg commit -m aa | |
262 $ hg push | |
17022
8a38839ae1dc
test-subrepo-git.t: adapt for Windows
Eduard-Cristian Stefan <alexandrul.ct@gmail.com>
parents:
16913
diff
changeset
|
263 pushing to $TESTTMP/t (glob) |
13029 | 264 searching for changes |
265 adding changesets | |
266 adding manifests | |
267 adding file changes | |
268 added 1 changesets with 1 changes to 1 files | |
269 | |
13087
cca0779b4832
subrepo: lazily update git's local tracking branches
Eric Eisner <ede@mit.edu>
parents:
13029
diff
changeset
|
270 sync to upstream git, distribute changes |
cca0779b4832
subrepo: lazily update git's local tracking branches
Eric Eisner <ede@mit.edu>
parents:
13029
diff
changeset
|
271 |
cca0779b4832
subrepo: lazily update git's local tracking branches
Eric Eisner <ede@mit.edu>
parents:
13029
diff
changeset
|
272 $ cd ../ta |
cca0779b4832
subrepo: lazily update git's local tracking branches
Eric Eisner <ede@mit.edu>
parents:
13029
diff
changeset
|
273 $ hg pull -u -q |
cca0779b4832
subrepo: lazily update git's local tracking branches
Eric Eisner <ede@mit.edu>
parents:
13029
diff
changeset
|
274 $ cd s |
13091
8cecea387574
test-subrepo-git.t: silence git output
Eric Eisner <ede@mit.edu>
parents:
13087
diff
changeset
|
275 $ git pull -q >/dev/null 2>/dev/null |
13087
cca0779b4832
subrepo: lazily update git's local tracking branches
Eric Eisner <ede@mit.edu>
parents:
13029
diff
changeset
|
276 $ cd .. |
cca0779b4832
subrepo: lazily update git's local tracking branches
Eric Eisner <ede@mit.edu>
parents:
13029
diff
changeset
|
277 $ hg commit -m 'git upstream sync' |
cca0779b4832
subrepo: lazily update git's local tracking branches
Eric Eisner <ede@mit.edu>
parents:
13029
diff
changeset
|
278 $ hg debugsub |
cca0779b4832
subrepo: lazily update git's local tracking branches
Eric Eisner <ede@mit.edu>
parents:
13029
diff
changeset
|
279 path s |
cca0779b4832
subrepo: lazily update git's local tracking branches
Eric Eisner <ede@mit.edu>
parents:
13029
diff
changeset
|
280 source ../gitroot |
cca0779b4832
subrepo: lazily update git's local tracking branches
Eric Eisner <ede@mit.edu>
parents:
13029
diff
changeset
|
281 revision 32a343883b74769118bb1d3b4b1fbf9156f4dddc |
cca0779b4832
subrepo: lazily update git's local tracking branches
Eric Eisner <ede@mit.edu>
parents:
13029
diff
changeset
|
282 $ hg push -q |
cca0779b4832
subrepo: lazily update git's local tracking branches
Eric Eisner <ede@mit.edu>
parents:
13029
diff
changeset
|
283 |
cca0779b4832
subrepo: lazily update git's local tracking branches
Eric Eisner <ede@mit.edu>
parents:
13029
diff
changeset
|
284 $ cd ../tb |
cca0779b4832
subrepo: lazily update git's local tracking branches
Eric Eisner <ede@mit.edu>
parents:
13029
diff
changeset
|
285 $ hg pull -q |
13091
8cecea387574
test-subrepo-git.t: silence git output
Eric Eisner <ede@mit.edu>
parents:
13087
diff
changeset
|
286 $ hg update 2>/dev/null |
13569
3ab3b892d223
subrepo: show the source that git pulls
Eric Eisner <ede@mit.edu>
parents:
13560
diff
changeset
|
287 pulling subrepo s from $TESTTMP/gitroot |
13087
cca0779b4832
subrepo: lazily update git's local tracking branches
Eric Eisner <ede@mit.edu>
parents:
13029
diff
changeset
|
288 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
cca0779b4832
subrepo: lazily update git's local tracking branches
Eric Eisner <ede@mit.edu>
parents:
13029
diff
changeset
|
289 $ hg debugsub |
cca0779b4832
subrepo: lazily update git's local tracking branches
Eric Eisner <ede@mit.edu>
parents:
13029
diff
changeset
|
290 path s |
cca0779b4832
subrepo: lazily update git's local tracking branches
Eric Eisner <ede@mit.edu>
parents:
13029
diff
changeset
|
291 source ../gitroot |
cca0779b4832
subrepo: lazily update git's local tracking branches
Eric Eisner <ede@mit.edu>
parents:
13029
diff
changeset
|
292 revision 32a343883b74769118bb1d3b4b1fbf9156f4dddc |
cca0779b4832
subrepo: lazily update git's local tracking branches
Eric Eisner <ede@mit.edu>
parents:
13029
diff
changeset
|
293 |
19013
2b34d004e644
subrepo: add regression test for issue3870
Kevin Bullock <kbullock@ringworld.org>
parents:
18109
diff
changeset
|
294 create a new git branch |
2b34d004e644
subrepo: add regression test for issue3870
Kevin Bullock <kbullock@ringworld.org>
parents:
18109
diff
changeset
|
295 |
2b34d004e644
subrepo: add regression test for issue3870
Kevin Bullock <kbullock@ringworld.org>
parents:
18109
diff
changeset
|
296 $ cd s |
2b34d004e644
subrepo: add regression test for issue3870
Kevin Bullock <kbullock@ringworld.org>
parents:
18109
diff
changeset
|
297 $ git checkout -b b2 |
2b34d004e644
subrepo: add regression test for issue3870
Kevin Bullock <kbullock@ringworld.org>
parents:
18109
diff
changeset
|
298 Switched to a new branch 'b2' |
2b34d004e644
subrepo: add regression test for issue3870
Kevin Bullock <kbullock@ringworld.org>
parents:
18109
diff
changeset
|
299 $ echo a>a |
2b34d004e644
subrepo: add regression test for issue3870
Kevin Bullock <kbullock@ringworld.org>
parents:
18109
diff
changeset
|
300 $ git add a |
2b34d004e644
subrepo: add regression test for issue3870
Kevin Bullock <kbullock@ringworld.org>
parents:
18109
diff
changeset
|
301 $ git commit -qm 'add a' |
2b34d004e644
subrepo: add regression test for issue3870
Kevin Bullock <kbullock@ringworld.org>
parents:
18109
diff
changeset
|
302 $ cd .. |
2b34d004e644
subrepo: add regression test for issue3870
Kevin Bullock <kbullock@ringworld.org>
parents:
18109
diff
changeset
|
303 $ hg commit -m 'add branch in s' |
2b34d004e644
subrepo: add regression test for issue3870
Kevin Bullock <kbullock@ringworld.org>
parents:
18109
diff
changeset
|
304 |
2b34d004e644
subrepo: add regression test for issue3870
Kevin Bullock <kbullock@ringworld.org>
parents:
18109
diff
changeset
|
305 pulling new git branch should not create tracking branch named 'origin/b2' |
2b34d004e644
subrepo: add regression test for issue3870
Kevin Bullock <kbullock@ringworld.org>
parents:
18109
diff
changeset
|
306 (issue3870) |
2b34d004e644
subrepo: add regression test for issue3870
Kevin Bullock <kbullock@ringworld.org>
parents:
18109
diff
changeset
|
307 $ cd ../td/s |
2b34d004e644
subrepo: add regression test for issue3870
Kevin Bullock <kbullock@ringworld.org>
parents:
18109
diff
changeset
|
308 $ git remote set-url origin $TESTTMP/tb/s |
19049
2e5476980a57
subrepo: fix test breakage introduced in 2b34d004e644
Kevin Bullock <kbullock@ringworld.org>
parents:
19013
diff
changeset
|
309 $ git branch --no-track oldtesting |
19013
2b34d004e644
subrepo: add regression test for issue3870
Kevin Bullock <kbullock@ringworld.org>
parents:
18109
diff
changeset
|
310 $ cd .. |
2b34d004e644
subrepo: add regression test for issue3870
Kevin Bullock <kbullock@ringworld.org>
parents:
18109
diff
changeset
|
311 $ hg pull -q ../tb |
2b34d004e644
subrepo: add regression test for issue3870
Kevin Bullock <kbullock@ringworld.org>
parents:
18109
diff
changeset
|
312 $ hg up |
2b34d004e644
subrepo: add regression test for issue3870
Kevin Bullock <kbullock@ringworld.org>
parents:
18109
diff
changeset
|
313 From $TESTTMP/tb/s |
2b34d004e644
subrepo: add regression test for issue3870
Kevin Bullock <kbullock@ringworld.org>
parents:
18109
diff
changeset
|
314 * [new branch] b2 -> origin/b2 |
2b34d004e644
subrepo: add regression test for issue3870
Kevin Bullock <kbullock@ringworld.org>
parents:
18109
diff
changeset
|
315 Previous HEAD position was f47b465... merge |
2b34d004e644
subrepo: add regression test for issue3870
Kevin Bullock <kbullock@ringworld.org>
parents:
18109
diff
changeset
|
316 Switched to a new branch 'b2' |
2b34d004e644
subrepo: add regression test for issue3870
Kevin Bullock <kbullock@ringworld.org>
parents:
18109
diff
changeset
|
317 pulling subrepo s from $TESTTMP/tb/s |
2b34d004e644
subrepo: add regression test for issue3870
Kevin Bullock <kbullock@ringworld.org>
parents:
18109
diff
changeset
|
318 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
2b34d004e644
subrepo: add regression test for issue3870
Kevin Bullock <kbullock@ringworld.org>
parents:
18109
diff
changeset
|
319 |
12996
3a42651b0a62
subrepo: removing (and restoring) git subrepo state
Eric Eisner <ede@mit.edu>
parents:
12995
diff
changeset
|
320 update to a revision without the subrepo, keeping the local git repository |
3a42651b0a62
subrepo: removing (and restoring) git subrepo state
Eric Eisner <ede@mit.edu>
parents:
12995
diff
changeset
|
321 |
3a42651b0a62
subrepo: removing (and restoring) git subrepo state
Eric Eisner <ede@mit.edu>
parents:
12995
diff
changeset
|
322 $ cd ../t |
3a42651b0a62
subrepo: removing (and restoring) git subrepo state
Eric Eisner <ede@mit.edu>
parents:
12995
diff
changeset
|
323 $ hg up 0 |
3a42651b0a62
subrepo: removing (and restoring) git subrepo state
Eric Eisner <ede@mit.edu>
parents:
12995
diff
changeset
|
324 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
13010
6bdae8ea0b48
test-subrepo-git.t: portability fix.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
12996
diff
changeset
|
325 $ ls -a s |
12996
3a42651b0a62
subrepo: removing (and restoring) git subrepo state
Eric Eisner <ede@mit.edu>
parents:
12995
diff
changeset
|
326 . |
3a42651b0a62
subrepo: removing (and restoring) git subrepo state
Eric Eisner <ede@mit.edu>
parents:
12995
diff
changeset
|
327 .. |
3a42651b0a62
subrepo: removing (and restoring) git subrepo state
Eric Eisner <ede@mit.edu>
parents:
12995
diff
changeset
|
328 .git |
3a42651b0a62
subrepo: removing (and restoring) git subrepo state
Eric Eisner <ede@mit.edu>
parents:
12995
diff
changeset
|
329 |
3a42651b0a62
subrepo: removing (and restoring) git subrepo state
Eric Eisner <ede@mit.edu>
parents:
12995
diff
changeset
|
330 $ hg up 2 |
3a42651b0a62
subrepo: removing (and restoring) git subrepo state
Eric Eisner <ede@mit.edu>
parents:
12995
diff
changeset
|
331 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
13010
6bdae8ea0b48
test-subrepo-git.t: portability fix.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
12996
diff
changeset
|
332 $ ls -a s |
12996
3a42651b0a62
subrepo: removing (and restoring) git subrepo state
Eric Eisner <ede@mit.edu>
parents:
12995
diff
changeset
|
333 . |
3a42651b0a62
subrepo: removing (and restoring) git subrepo state
Eric Eisner <ede@mit.edu>
parents:
12995
diff
changeset
|
334 .. |
3a42651b0a62
subrepo: removing (and restoring) git subrepo state
Eric Eisner <ede@mit.edu>
parents:
12995
diff
changeset
|
335 .git |
3a42651b0a62
subrepo: removing (and restoring) git subrepo state
Eric Eisner <ede@mit.edu>
parents:
12995
diff
changeset
|
336 g |
13027 | 337 |
338 archive subrepos | |
339 | |
13091
8cecea387574
test-subrepo-git.t: silence git output
Eric Eisner <ede@mit.edu>
parents:
13087
diff
changeset
|
340 $ cd ../tc |
8cecea387574
test-subrepo-git.t: silence git output
Eric Eisner <ede@mit.edu>
parents:
13087
diff
changeset
|
341 $ hg pull -q |
8cecea387574
test-subrepo-git.t: silence git output
Eric Eisner <ede@mit.edu>
parents:
13087
diff
changeset
|
342 $ hg archive --subrepos -r 5 ../archive 2>/dev/null |
13569
3ab3b892d223
subrepo: show the source that git pulls
Eric Eisner <ede@mit.edu>
parents:
13560
diff
changeset
|
343 pulling subrepo s from $TESTTMP/gitroot |
13027 | 344 $ cd ../archive |
345 $ cat s/f | |
346 f | |
347 $ cat s/g | |
348 g | |
349 gg | |
350 ggg | |
13181
413bef846806
subrepo: fix subrelpath for git subrepos
Eric Eisner <ede@mit.edu>
parents:
13111
diff
changeset
|
351 |
17108
1894dac619de
subrepo: propagate matcher to subrepos when archiving
Matt Harbison <matt_harbison@yahoo.com>
parents:
17022
diff
changeset
|
352 $ hg -R ../tc archive --subrepo -r 5 -X ../tc/**f ../archive_x 2>/dev/null |
17114
ca75bd99f740
tests: ignore pax_global_header in test-subrepo-git.t
Mads Kiilerich <mads@kiilerich.com>
parents:
17108
diff
changeset
|
353 $ find ../archive_x | sort | grep -v pax_global_header |
17108
1894dac619de
subrepo: propagate matcher to subrepos when archiving
Matt Harbison <matt_harbison@yahoo.com>
parents:
17022
diff
changeset
|
354 ../archive_x |
1894dac619de
subrepo: propagate matcher to subrepos when archiving
Matt Harbison <matt_harbison@yahoo.com>
parents:
17022
diff
changeset
|
355 ../archive_x/.hg_archival.txt |
1894dac619de
subrepo: propagate matcher to subrepos when archiving
Matt Harbison <matt_harbison@yahoo.com>
parents:
17022
diff
changeset
|
356 ../archive_x/.hgsub |
1894dac619de
subrepo: propagate matcher to subrepos when archiving
Matt Harbison <matt_harbison@yahoo.com>
parents:
17022
diff
changeset
|
357 ../archive_x/.hgsubstate |
1894dac619de
subrepo: propagate matcher to subrepos when archiving
Matt Harbison <matt_harbison@yahoo.com>
parents:
17022
diff
changeset
|
358 ../archive_x/a |
1894dac619de
subrepo: propagate matcher to subrepos when archiving
Matt Harbison <matt_harbison@yahoo.com>
parents:
17022
diff
changeset
|
359 ../archive_x/s |
1894dac619de
subrepo: propagate matcher to subrepos when archiving
Matt Harbison <matt_harbison@yahoo.com>
parents:
17022
diff
changeset
|
360 ../archive_x/s/g |
1894dac619de
subrepo: propagate matcher to subrepos when archiving
Matt Harbison <matt_harbison@yahoo.com>
parents:
17022
diff
changeset
|
361 |
24953
5115d03440f4
archive: drop the leading '.' path component from the prefix (issue4634)
Matt Harbison <matt_harbison@yahoo.com>
parents:
24943
diff
changeset
|
362 $ hg -R ../tc archive -S ../archive.tgz --prefix '.' 2>/dev/null |
24964
fc92ccbbeb9a
test-subrepo-git: ignore pax_global_header when listing archive
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
24953
diff
changeset
|
363 $ tar -tzf ../archive.tgz | sort | grep -v pax_global_header |
24953
5115d03440f4
archive: drop the leading '.' path component from the prefix (issue4634)
Matt Harbison <matt_harbison@yahoo.com>
parents:
24943
diff
changeset
|
364 .hg_archival.txt |
5115d03440f4
archive: drop the leading '.' path component from the prefix (issue4634)
Matt Harbison <matt_harbison@yahoo.com>
parents:
24943
diff
changeset
|
365 .hgsub |
5115d03440f4
archive: drop the leading '.' path component from the prefix (issue4634)
Matt Harbison <matt_harbison@yahoo.com>
parents:
24943
diff
changeset
|
366 .hgsubstate |
5115d03440f4
archive: drop the leading '.' path component from the prefix (issue4634)
Matt Harbison <matt_harbison@yahoo.com>
parents:
24943
diff
changeset
|
367 a |
5115d03440f4
archive: drop the leading '.' path component from the prefix (issue4634)
Matt Harbison <matt_harbison@yahoo.com>
parents:
24943
diff
changeset
|
368 s/g |
24924
41cd8171e58f
archive: always use portable path component separators with subrepos
Matt Harbison <matt_harbison@yahoo.com>
parents:
24902
diff
changeset
|
369 |
13181
413bef846806
subrepo: fix subrelpath for git subrepos
Eric Eisner <ede@mit.edu>
parents:
13111
diff
changeset
|
370 create nested repo |
413bef846806
subrepo: fix subrelpath for git subrepos
Eric Eisner <ede@mit.edu>
parents:
13111
diff
changeset
|
371 |
413bef846806
subrepo: fix subrelpath for git subrepos
Eric Eisner <ede@mit.edu>
parents:
13111
diff
changeset
|
372 $ cd .. |
413bef846806
subrepo: fix subrelpath for git subrepos
Eric Eisner <ede@mit.edu>
parents:
13111
diff
changeset
|
373 $ hg init outer |
413bef846806
subrepo: fix subrelpath for git subrepos
Eric Eisner <ede@mit.edu>
parents:
13111
diff
changeset
|
374 $ cd outer |
413bef846806
subrepo: fix subrelpath for git subrepos
Eric Eisner <ede@mit.edu>
parents:
13111
diff
changeset
|
375 $ echo b>b |
413bef846806
subrepo: fix subrelpath for git subrepos
Eric Eisner <ede@mit.edu>
parents:
13111
diff
changeset
|
376 $ hg add b |
413bef846806
subrepo: fix subrelpath for git subrepos
Eric Eisner <ede@mit.edu>
parents:
13111
diff
changeset
|
377 $ hg commit -m b |
413bef846806
subrepo: fix subrelpath for git subrepos
Eric Eisner <ede@mit.edu>
parents:
13111
diff
changeset
|
378 |
20105
c5a0f899e47b
tests: deal with new gits sending status messages to stderr
Mads Kiilerich <madski@unity3d.com>
parents:
19811
diff
changeset
|
379 $ hg clone ../t inner 2> /dev/null |
13181
413bef846806
subrepo: fix subrelpath for git subrepos
Eric Eisner <ede@mit.edu>
parents:
13111
diff
changeset
|
380 updating to branch default |
13525
c12088259f64
subrepo: show the source that git clones
Eric Eisner <ede@mit.edu>
parents:
13460
diff
changeset
|
381 cloning subrepo s from $TESTTMP/gitroot |
13181
413bef846806
subrepo: fix subrelpath for git subrepos
Eric Eisner <ede@mit.edu>
parents:
13111
diff
changeset
|
382 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
413bef846806
subrepo: fix subrelpath for git subrepos
Eric Eisner <ede@mit.edu>
parents:
13111
diff
changeset
|
383 $ echo inner = inner > .hgsub |
413bef846806
subrepo: fix subrelpath for git subrepos
Eric Eisner <ede@mit.edu>
parents:
13111
diff
changeset
|
384 $ hg add .hgsub |
413bef846806
subrepo: fix subrelpath for git subrepos
Eric Eisner <ede@mit.edu>
parents:
13111
diff
changeset
|
385 $ hg commit -m 'nested sub' |
413bef846806
subrepo: fix subrelpath for git subrepos
Eric Eisner <ede@mit.edu>
parents:
13111
diff
changeset
|
386 |
413bef846806
subrepo: fix subrelpath for git subrepos
Eric Eisner <ede@mit.edu>
parents:
13111
diff
changeset
|
387 nested commit |
413bef846806
subrepo: fix subrelpath for git subrepos
Eric Eisner <ede@mit.edu>
parents:
13111
diff
changeset
|
388 |
413bef846806
subrepo: fix subrelpath for git subrepos
Eric Eisner <ede@mit.edu>
parents:
13111
diff
changeset
|
389 $ echo ffff >> inner/s/f |
13182
2537bd17421d
subrepo: basic support for status of git subrepos
Eric Eisner <ede@mit.edu>
parents:
13181
diff
changeset
|
390 $ hg status --subrepos |
2537bd17421d
subrepo: basic support for status of git subrepos
Eric Eisner <ede@mit.edu>
parents:
13181
diff
changeset
|
391 M inner/s/f |
15321
e174353e8cda
subrepos: abort commit by default if a subrepo is dirty (BC)
Martin Geisler <mg@lazybytes.net>
parents:
14481
diff
changeset
|
392 $ hg commit --subrepos -m nested |
13181
413bef846806
subrepo: fix subrelpath for git subrepos
Eric Eisner <ede@mit.edu>
parents:
13111
diff
changeset
|
393 committing subrepository inner |
17022
8a38839ae1dc
test-subrepo-git.t: adapt for Windows
Eduard-Cristian Stefan <alexandrul.ct@gmail.com>
parents:
16913
diff
changeset
|
394 committing subrepository inner/s (glob) |
13181
413bef846806
subrepo: fix subrelpath for git subrepos
Eric Eisner <ede@mit.edu>
parents:
13111
diff
changeset
|
395 |
413bef846806
subrepo: fix subrelpath for git subrepos
Eric Eisner <ede@mit.edu>
parents:
13111
diff
changeset
|
396 nested archive |
413bef846806
subrepo: fix subrelpath for git subrepos
Eric Eisner <ede@mit.edu>
parents:
13111
diff
changeset
|
397 |
413bef846806
subrepo: fix subrelpath for git subrepos
Eric Eisner <ede@mit.edu>
parents:
13111
diff
changeset
|
398 $ hg archive --subrepos ../narchive |
13296
5dda6c708138
Ignore pax_global_header that some tar versions write as a file.
Lee Cantey <lcantey@embarcadero.com>
parents:
13182
diff
changeset
|
399 $ ls ../narchive/inner/s | grep -v pax_global_header |
13181
413bef846806
subrepo: fix subrelpath for git subrepos
Eric Eisner <ede@mit.edu>
parents:
13111
diff
changeset
|
400 f |
413bef846806
subrepo: fix subrelpath for git subrepos
Eric Eisner <ede@mit.edu>
parents:
13111
diff
changeset
|
401 g |
13324
e5617047c926
subrepo: make update -C clean the working directory for git subrepos
Erik Zielke <ez@aragost.com>
parents:
13296
diff
changeset
|
402 |
13460
64bb8e586a92
subrepo: expand relative sources for git subrepos
Eric Eisner <ede@mit.edu>
parents:
13428
diff
changeset
|
403 relative source expansion |
64bb8e586a92
subrepo: expand relative sources for git subrepos
Eric Eisner <ede@mit.edu>
parents:
13428
diff
changeset
|
404 |
64bb8e586a92
subrepo: expand relative sources for git subrepos
Eric Eisner <ede@mit.edu>
parents:
13428
diff
changeset
|
405 $ cd .. |
64bb8e586a92
subrepo: expand relative sources for git subrepos
Eric Eisner <ede@mit.edu>
parents:
13428
diff
changeset
|
406 $ mkdir d |
20105
c5a0f899e47b
tests: deal with new gits sending status messages to stderr
Mads Kiilerich <madski@unity3d.com>
parents:
19811
diff
changeset
|
407 $ hg clone t d/t 2> /dev/null |
13460
64bb8e586a92
subrepo: expand relative sources for git subrepos
Eric Eisner <ede@mit.edu>
parents:
13428
diff
changeset
|
408 updating to branch default |
13525
c12088259f64
subrepo: show the source that git clones
Eric Eisner <ede@mit.edu>
parents:
13460
diff
changeset
|
409 cloning subrepo s from $TESTTMP/gitroot |
13460
64bb8e586a92
subrepo: expand relative sources for git subrepos
Eric Eisner <ede@mit.edu>
parents:
13428
diff
changeset
|
410 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
64bb8e586a92
subrepo: expand relative sources for git subrepos
Eric Eisner <ede@mit.edu>
parents:
13428
diff
changeset
|
411 |
13553
dea6efdd7ec4
subrepo: don't crash when git repo is missing
Eric Eisner <ede@mit.edu>
parents:
13460
diff
changeset
|
412 Don't crash if the subrepo is missing |
dea6efdd7ec4
subrepo: don't crash when git repo is missing
Eric Eisner <ede@mit.edu>
parents:
13460
diff
changeset
|
413 |
dea6efdd7ec4
subrepo: don't crash when git repo is missing
Eric Eisner <ede@mit.edu>
parents:
13460
diff
changeset
|
414 $ hg clone t missing -q |
dea6efdd7ec4
subrepo: don't crash when git repo is missing
Eric Eisner <ede@mit.edu>
parents:
13460
diff
changeset
|
415 $ cd missing |
dea6efdd7ec4
subrepo: don't crash when git repo is missing
Eric Eisner <ede@mit.edu>
parents:
13460
diff
changeset
|
416 $ rm -rf s |
dea6efdd7ec4
subrepo: don't crash when git repo is missing
Eric Eisner <ede@mit.edu>
parents:
13460
diff
changeset
|
417 $ hg status -S |
dea6efdd7ec4
subrepo: don't crash when git repo is missing
Eric Eisner <ede@mit.edu>
parents:
13460
diff
changeset
|
418 $ hg sum | grep commit |
dea6efdd7ec4
subrepo: don't crash when git repo is missing
Eric Eisner <ede@mit.edu>
parents:
13460
diff
changeset
|
419 commit: 1 subrepos |
dea6efdd7ec4
subrepo: don't crash when git repo is missing
Eric Eisner <ede@mit.edu>
parents:
13460
diff
changeset
|
420 $ hg push -q |
33365
6d88468d435b
subrepo: make the output references to subrepositories consistent
Matt Harbison <matt_harbison@yahoo.com>
parents:
32902
diff
changeset
|
421 abort: subrepo s is missing (in subrepository "s") |
13553
dea6efdd7ec4
subrepo: don't crash when git repo is missing
Eric Eisner <ede@mit.edu>
parents:
13460
diff
changeset
|
422 [255] |
15321
e174353e8cda
subrepos: abort commit by default if a subrepo is dirty (BC)
Martin Geisler <mg@lazybytes.net>
parents:
14481
diff
changeset
|
423 $ hg commit --subrepos -qm missing |
33365
6d88468d435b
subrepo: make the output references to subrepositories consistent
Matt Harbison <matt_harbison@yahoo.com>
parents:
32902
diff
changeset
|
424 abort: subrepo s is missing (in subrepository "s") |
13553
dea6efdd7ec4
subrepo: don't crash when git repo is missing
Eric Eisner <ede@mit.edu>
parents:
13460
diff
changeset
|
425 [255] |
24902
986a5c23b1c1
util.checkcase: don't abort on broken symlinks
Siddharth Agarwal <sid0@fb.com>
parents:
24778
diff
changeset
|
426 |
986a5c23b1c1
util.checkcase: don't abort on broken symlinks
Siddharth Agarwal <sid0@fb.com>
parents:
24778
diff
changeset
|
427 #if symlink |
986a5c23b1c1
util.checkcase: don't abort on broken symlinks
Siddharth Agarwal <sid0@fb.com>
parents:
24778
diff
changeset
|
428 Don't crash if subrepo is a broken symlink |
986a5c23b1c1
util.checkcase: don't abort on broken symlinks
Siddharth Agarwal <sid0@fb.com>
parents:
24778
diff
changeset
|
429 $ ln -s broken s |
986a5c23b1c1
util.checkcase: don't abort on broken symlinks
Siddharth Agarwal <sid0@fb.com>
parents:
24778
diff
changeset
|
430 $ hg status -S |
34984
071cbeba4212
subrepo: disallow symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
34661
diff
changeset
|
431 abort: subrepo 's' traverses symbolic link |
071cbeba4212
subrepo: disallow symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
34661
diff
changeset
|
432 [255] |
24902
986a5c23b1c1
util.checkcase: don't abort on broken symlinks
Siddharth Agarwal <sid0@fb.com>
parents:
24778
diff
changeset
|
433 $ hg push -q |
34984
071cbeba4212
subrepo: disallow symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
34661
diff
changeset
|
434 abort: subrepo 's' traverses symbolic link |
24902
986a5c23b1c1
util.checkcase: don't abort on broken symlinks
Siddharth Agarwal <sid0@fb.com>
parents:
24778
diff
changeset
|
435 [255] |
986a5c23b1c1
util.checkcase: don't abort on broken symlinks
Siddharth Agarwal <sid0@fb.com>
parents:
24778
diff
changeset
|
436 $ hg commit --subrepos -qm missing |
34984
071cbeba4212
subrepo: disallow symlink traversal across subrepo mount point (SEC)
Yuya Nishihara <yuya@tcha.org>
parents:
34661
diff
changeset
|
437 abort: subrepo 's' traverses symbolic link |
24902
986a5c23b1c1
util.checkcase: don't abort on broken symlinks
Siddharth Agarwal <sid0@fb.com>
parents:
24778
diff
changeset
|
438 [255] |
986a5c23b1c1
util.checkcase: don't abort on broken symlinks
Siddharth Agarwal <sid0@fb.com>
parents:
24778
diff
changeset
|
439 $ rm s |
986a5c23b1c1
util.checkcase: don't abort on broken symlinks
Siddharth Agarwal <sid0@fb.com>
parents:
24778
diff
changeset
|
440 #endif |
986a5c23b1c1
util.checkcase: don't abort on broken symlinks
Siddharth Agarwal <sid0@fb.com>
parents:
24778
diff
changeset
|
441 |
20105
c5a0f899e47b
tests: deal with new gits sending status messages to stderr
Mads Kiilerich <madski@unity3d.com>
parents:
19811
diff
changeset
|
442 $ hg update -C 2> /dev/null |
13560 | 443 cloning subrepo s from $TESTTMP/gitroot |
13553
dea6efdd7ec4
subrepo: don't crash when git repo is missing
Eric Eisner <ede@mit.edu>
parents:
13460
diff
changeset
|
444 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
dea6efdd7ec4
subrepo: don't crash when git repo is missing
Eric Eisner <ede@mit.edu>
parents:
13460
diff
changeset
|
445 $ hg sum | grep commit |
dea6efdd7ec4
subrepo: don't crash when git repo is missing
Eric Eisner <ede@mit.edu>
parents:
13460
diff
changeset
|
446 commit: (clean) |
dea6efdd7ec4
subrepo: don't crash when git repo is missing
Eric Eisner <ede@mit.edu>
parents:
13460
diff
changeset
|
447 |
14469
2fdea636f254
subrepo: don't crash when git .hgsubstate is empty (issue2716)
Eric Eisner <ede@alum.mit.edu>
parents:
13553
diff
changeset
|
448 Don't crash if the .hgsubstate entry is missing |
2fdea636f254
subrepo: don't crash when git .hgsubstate is empty (issue2716)
Eric Eisner <ede@alum.mit.edu>
parents:
13553
diff
changeset
|
449 |
2fdea636f254
subrepo: don't crash when git .hgsubstate is empty (issue2716)
Eric Eisner <ede@alum.mit.edu>
parents:
13553
diff
changeset
|
450 $ hg update 1 -q |
2fdea636f254
subrepo: don't crash when git .hgsubstate is empty (issue2716)
Eric Eisner <ede@alum.mit.edu>
parents:
13553
diff
changeset
|
451 $ hg rm .hgsubstate |
2fdea636f254
subrepo: don't crash when git .hgsubstate is empty (issue2716)
Eric Eisner <ede@alum.mit.edu>
parents:
13553
diff
changeset
|
452 $ hg commit .hgsubstate -m 'no substate' |
16073
b254f827b7a6
subrepo: rewrite handling of subrepo state at commit (issue2403)
Matt Mackall <mpm@selenic.com>
parents:
15531
diff
changeset
|
453 nothing changed |
b254f827b7a6
subrepo: rewrite handling of subrepo state at commit (issue2403)
Matt Mackall <mpm@selenic.com>
parents:
15531
diff
changeset
|
454 [1] |
14469
2fdea636f254
subrepo: don't crash when git .hgsubstate is empty (issue2716)
Eric Eisner <ede@alum.mit.edu>
parents:
13553
diff
changeset
|
455 $ hg tag -l nosubstate |
2fdea636f254
subrepo: don't crash when git .hgsubstate is empty (issue2716)
Eric Eisner <ede@alum.mit.edu>
parents:
13553
diff
changeset
|
456 $ hg manifest |
2fdea636f254
subrepo: don't crash when git .hgsubstate is empty (issue2716)
Eric Eisner <ede@alum.mit.edu>
parents:
13553
diff
changeset
|
457 .hgsub |
16073
b254f827b7a6
subrepo: rewrite handling of subrepo state at commit (issue2403)
Matt Mackall <mpm@selenic.com>
parents:
15531
diff
changeset
|
458 .hgsubstate |
14469
2fdea636f254
subrepo: don't crash when git .hgsubstate is empty (issue2716)
Eric Eisner <ede@alum.mit.edu>
parents:
13553
diff
changeset
|
459 a |
2fdea636f254
subrepo: don't crash when git .hgsubstate is empty (issue2716)
Eric Eisner <ede@alum.mit.edu>
parents:
13553
diff
changeset
|
460 |
2fdea636f254
subrepo: don't crash when git .hgsubstate is empty (issue2716)
Eric Eisner <ede@alum.mit.edu>
parents:
13553
diff
changeset
|
461 $ hg status -S |
16073
b254f827b7a6
subrepo: rewrite handling of subrepo state at commit (issue2403)
Matt Mackall <mpm@selenic.com>
parents:
15531
diff
changeset
|
462 R .hgsubstate |
14469
2fdea636f254
subrepo: don't crash when git .hgsubstate is empty (issue2716)
Eric Eisner <ede@alum.mit.edu>
parents:
13553
diff
changeset
|
463 $ hg sum | grep commit |
16073
b254f827b7a6
subrepo: rewrite handling of subrepo state at commit (issue2403)
Matt Mackall <mpm@selenic.com>
parents:
15531
diff
changeset
|
464 commit: 1 removed, 1 subrepos (new branch head) |
14469
2fdea636f254
subrepo: don't crash when git .hgsubstate is empty (issue2716)
Eric Eisner <ede@alum.mit.edu>
parents:
13553
diff
changeset
|
465 |
2fdea636f254
subrepo: don't crash when git .hgsubstate is empty (issue2716)
Eric Eisner <ede@alum.mit.edu>
parents:
13553
diff
changeset
|
466 $ hg commit -m 'restore substate' |
16073
b254f827b7a6
subrepo: rewrite handling of subrepo state at commit (issue2403)
Matt Mackall <mpm@selenic.com>
parents:
15531
diff
changeset
|
467 nothing changed |
b254f827b7a6
subrepo: rewrite handling of subrepo state at commit (issue2403)
Matt Mackall <mpm@selenic.com>
parents:
15531
diff
changeset
|
468 [1] |
14469
2fdea636f254
subrepo: don't crash when git .hgsubstate is empty (issue2716)
Eric Eisner <ede@alum.mit.edu>
parents:
13553
diff
changeset
|
469 $ hg manifest |
2fdea636f254
subrepo: don't crash when git .hgsubstate is empty (issue2716)
Eric Eisner <ede@alum.mit.edu>
parents:
13553
diff
changeset
|
470 .hgsub |
2fdea636f254
subrepo: don't crash when git .hgsubstate is empty (issue2716)
Eric Eisner <ede@alum.mit.edu>
parents:
13553
diff
changeset
|
471 .hgsubstate |
2fdea636f254
subrepo: don't crash when git .hgsubstate is empty (issue2716)
Eric Eisner <ede@alum.mit.edu>
parents:
13553
diff
changeset
|
472 a |
2fdea636f254
subrepo: don't crash when git .hgsubstate is empty (issue2716)
Eric Eisner <ede@alum.mit.edu>
parents:
13553
diff
changeset
|
473 $ hg sum | grep commit |
16073
b254f827b7a6
subrepo: rewrite handling of subrepo state at commit (issue2403)
Matt Mackall <mpm@selenic.com>
parents:
15531
diff
changeset
|
474 commit: 1 removed, 1 subrepos (new branch head) |
14469
2fdea636f254
subrepo: don't crash when git .hgsubstate is empty (issue2716)
Eric Eisner <ede@alum.mit.edu>
parents:
13553
diff
changeset
|
475 |
2fdea636f254
subrepo: don't crash when git .hgsubstate is empty (issue2716)
Eric Eisner <ede@alum.mit.edu>
parents:
13553
diff
changeset
|
476 $ hg update -qC nosubstate |
2fdea636f254
subrepo: don't crash when git .hgsubstate is empty (issue2716)
Eric Eisner <ede@alum.mit.edu>
parents:
13553
diff
changeset
|
477 $ ls s |
16073
b254f827b7a6
subrepo: rewrite handling of subrepo state at commit (issue2403)
Matt Mackall <mpm@selenic.com>
parents:
15531
diff
changeset
|
478 g |
14469
2fdea636f254
subrepo: don't crash when git .hgsubstate is empty (issue2716)
Eric Eisner <ede@alum.mit.edu>
parents:
13553
diff
changeset
|
479 |
15531
0810ccc51f0a
subrepo: fix git status false positive (issue3109)
Eric Roshan Eisner <ede@alum.mit.edu>
parents:
15321
diff
changeset
|
480 issue3109: false positives in git diff-index |
0810ccc51f0a
subrepo: fix git status false positive (issue3109)
Eric Roshan Eisner <ede@alum.mit.edu>
parents:
15321
diff
changeset
|
481 |
0810ccc51f0a
subrepo: fix git status false positive (issue3109)
Eric Roshan Eisner <ede@alum.mit.edu>
parents:
15321
diff
changeset
|
482 $ hg update -q |
0810ccc51f0a
subrepo: fix git status false positive (issue3109)
Eric Roshan Eisner <ede@alum.mit.edu>
parents:
15321
diff
changeset
|
483 $ touch -t 200001010000 s/g |
0810ccc51f0a
subrepo: fix git status false positive (issue3109)
Eric Roshan Eisner <ede@alum.mit.edu>
parents:
15321
diff
changeset
|
484 $ hg status --subrepos |
0810ccc51f0a
subrepo: fix git status false positive (issue3109)
Eric Roshan Eisner <ede@alum.mit.edu>
parents:
15321
diff
changeset
|
485 $ touch -t 200001010000 s/g |
0810ccc51f0a
subrepo: fix git status false positive (issue3109)
Eric Roshan Eisner <ede@alum.mit.edu>
parents:
15321
diff
changeset
|
486 $ hg sum | grep commit |
0810ccc51f0a
subrepo: fix git status false positive (issue3109)
Eric Roshan Eisner <ede@alum.mit.edu>
parents:
15321
diff
changeset
|
487 commit: (clean) |
0810ccc51f0a
subrepo: fix git status false positive (issue3109)
Eric Roshan Eisner <ede@alum.mit.edu>
parents:
15321
diff
changeset
|
488 |
13324
e5617047c926
subrepo: make update -C clean the working directory for git subrepos
Erik Zielke <ez@aragost.com>
parents:
13296
diff
changeset
|
489 Check hg update --clean |
13331
9f2c6892e004
test-subrepo-git.t: make compatible with old git
Eric Eisner <ede@mit.edu>
parents:
13324
diff
changeset
|
490 $ cd $TESTTMP/ta |
13324
e5617047c926
subrepo: make update -C clean the working directory for git subrepos
Erik Zielke <ez@aragost.com>
parents:
13296
diff
changeset
|
491 $ echo > s/g |
e5617047c926
subrepo: make update -C clean the working directory for git subrepos
Erik Zielke <ez@aragost.com>
parents:
13296
diff
changeset
|
492 $ cd s |
e5617047c926
subrepo: make update -C clean the working directory for git subrepos
Erik Zielke <ez@aragost.com>
parents:
13296
diff
changeset
|
493 $ echo c1 > f1 |
e5617047c926
subrepo: make update -C clean the working directory for git subrepos
Erik Zielke <ez@aragost.com>
parents:
13296
diff
changeset
|
494 $ echo c1 > f2 |
e5617047c926
subrepo: make update -C clean the working directory for git subrepos
Erik Zielke <ez@aragost.com>
parents:
13296
diff
changeset
|
495 $ git add f1 |
e5617047c926
subrepo: make update -C clean the working directory for git subrepos
Erik Zielke <ez@aragost.com>
parents:
13296
diff
changeset
|
496 $ cd .. |
13331
9f2c6892e004
test-subrepo-git.t: make compatible with old git
Eric Eisner <ede@mit.edu>
parents:
13324
diff
changeset
|
497 $ hg status -S |
9f2c6892e004
test-subrepo-git.t: make compatible with old git
Eric Eisner <ede@mit.edu>
parents:
13324
diff
changeset
|
498 M s/g |
9f2c6892e004
test-subrepo-git.t: make compatible with old git
Eric Eisner <ede@mit.edu>
parents:
13324
diff
changeset
|
499 A s/f1 |
23411
2d86f4e38c08
subrepo: add status support for ignored files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
22590
diff
changeset
|
500 ? s/f2 |
13331
9f2c6892e004
test-subrepo-git.t: make compatible with old git
Eric Eisner <ede@mit.edu>
parents:
13324
diff
changeset
|
501 $ ls s |
9f2c6892e004
test-subrepo-git.t: make compatible with old git
Eric Eisner <ede@mit.edu>
parents:
13324
diff
changeset
|
502 f |
9f2c6892e004
test-subrepo-git.t: make compatible with old git
Eric Eisner <ede@mit.edu>
parents:
13324
diff
changeset
|
503 f1 |
9f2c6892e004
test-subrepo-git.t: make compatible with old git
Eric Eisner <ede@mit.edu>
parents:
13324
diff
changeset
|
504 f2 |
9f2c6892e004
test-subrepo-git.t: make compatible with old git
Eric Eisner <ede@mit.edu>
parents:
13324
diff
changeset
|
505 g |
9f2c6892e004
test-subrepo-git.t: make compatible with old git
Eric Eisner <ede@mit.edu>
parents:
13324
diff
changeset
|
506 $ hg update --clean |
9f2c6892e004
test-subrepo-git.t: make compatible with old git
Eric Eisner <ede@mit.edu>
parents:
13324
diff
changeset
|
507 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
9f2c6892e004
test-subrepo-git.t: make compatible with old git
Eric Eisner <ede@mit.edu>
parents:
13324
diff
changeset
|
508 $ hg status -S |
23411
2d86f4e38c08
subrepo: add status support for ignored files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
22590
diff
changeset
|
509 ? s/f1 |
2d86f4e38c08
subrepo: add status support for ignored files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
22590
diff
changeset
|
510 ? s/f2 |
13331
9f2c6892e004
test-subrepo-git.t: make compatible with old git
Eric Eisner <ede@mit.edu>
parents:
13324
diff
changeset
|
511 $ ls s |
9f2c6892e004
test-subrepo-git.t: make compatible with old git
Eric Eisner <ede@mit.edu>
parents:
13324
diff
changeset
|
512 f |
9f2c6892e004
test-subrepo-git.t: make compatible with old git
Eric Eisner <ede@mit.edu>
parents:
13324
diff
changeset
|
513 f1 |
9f2c6892e004
test-subrepo-git.t: make compatible with old git
Eric Eisner <ede@mit.edu>
parents:
13324
diff
changeset
|
514 f2 |
9f2c6892e004
test-subrepo-git.t: make compatible with old git
Eric Eisner <ede@mit.edu>
parents:
13324
diff
changeset
|
515 g |
13417
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
516 |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
517 Sticky subrepositories, no changes |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
518 $ cd $TESTTMP/ta |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
519 $ hg id -n |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
520 7 |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
521 $ cd s |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
522 $ git rev-parse HEAD |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
523 32a343883b74769118bb1d3b4b1fbf9156f4dddc |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
524 $ cd .. |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
525 $ hg update 1 > /dev/null 2>&1 |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
526 $ hg id -n |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
527 1 |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
528 $ cd s |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
529 $ git rev-parse HEAD |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
530 da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7 |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
531 $ cd .. |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
532 |
21024
7731a2281cf0
spelling: fixes from spell checker
Mads Kiilerich <madski@unity3d.com>
parents:
20105
diff
changeset
|
533 Sticky subrepositories, file changes |
13417
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
534 $ touch s/f1 |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
535 $ cd s |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
536 $ git add f1 |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
537 $ cd .. |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
538 $ hg id -n |
17255
3e856d8abe9c
identity: show trailing '+' for dirty subrepos (issue2839)
Patrick Mezard <patrick@mezard.eu>
parents:
17114
diff
changeset
|
539 1+ |
13417
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
540 $ cd s |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
541 $ git rev-parse HEAD |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
542 da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7 |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
543 $ cd .. |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
544 $ hg update 4 |
21401
2c364f7801c8
subrepo: use subrepo shortid method to generate subrepo diverged promptchoice
Angel Ezquerra <angel.ezquerra@gmail.com>
parents:
21024
diff
changeset
|
545 subrepository s diverged (local revision: da5f5b1, remote revision: aa84837) |
30060
a145161debed
merge: use labels in subrepo merge
Simon Farnsworth <simonfar@fb.com>
parents:
29328
diff
changeset
|
546 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m |
13417
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
547 subrepository sources for s differ |
22590
d4c972b97fee
subrepo: remove superfluous newline from subrepo prompt
Mads Kiilerich <madski@unity3d.com>
parents:
22046
diff
changeset
|
548 use (l)ocal source (da5f5b1) or (r)emote source (aa84837)? l |
13417
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
549 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
550 $ hg id -n |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
551 4+ |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
552 $ cd s |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
553 $ git rev-parse HEAD |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
554 da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7 |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
555 $ cd .. |
17345
4f8054d3171b
check-code: fix check for trailing whitespace on sh command lines
Mads Kiilerich <mads@kiilerich.com>
parents:
17255
diff
changeset
|
556 $ hg update --clean tip > /dev/null 2>&1 |
13417
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
557 |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
558 Sticky subrepository, revision updates |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
559 $ hg id -n |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
560 7 |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
561 $ cd s |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
562 $ git rev-parse HEAD |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
563 32a343883b74769118bb1d3b4b1fbf9156f4dddc |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
564 $ cd .. |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
565 $ cd s |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
566 $ git checkout aa84837ccfbdfedcdcdeeedc309d73e6eb069edc |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
567 Previous HEAD position was 32a3438... fff |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
568 HEAD is now at aa84837... f |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
569 $ cd .. |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
570 $ hg update 1 |
21401
2c364f7801c8
subrepo: use subrepo shortid method to generate subrepo diverged promptchoice
Angel Ezquerra <angel.ezquerra@gmail.com>
parents:
21024
diff
changeset
|
571 subrepository s diverged (local revision: 32a3438, remote revision: da5f5b1) |
30060
a145161debed
merge: use labels in subrepo merge
Simon Farnsworth <simonfar@fb.com>
parents:
29328
diff
changeset
|
572 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m |
13417
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
573 subrepository sources for s differ (in checked out version) |
22590
d4c972b97fee
subrepo: remove superfluous newline from subrepo prompt
Mads Kiilerich <madski@unity3d.com>
parents:
22046
diff
changeset
|
574 use (l)ocal source (32a3438) or (r)emote source (da5f5b1)? l |
13417
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
575 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
576 $ hg id -n |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
577 1+ |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
578 $ cd s |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
579 $ git rev-parse HEAD |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
580 aa84837ccfbdfedcdcdeeedc309d73e6eb069edc |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
581 $ cd .. |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
582 |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
583 Sticky subrepository, file changes and revision updates |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
584 $ touch s/f1 |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
585 $ cd s |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
586 $ git add f1 |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
587 $ git rev-parse HEAD |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
588 aa84837ccfbdfedcdcdeeedc309d73e6eb069edc |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
589 $ cd .. |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
590 $ hg id -n |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
591 1+ |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
592 $ hg update 7 |
21401
2c364f7801c8
subrepo: use subrepo shortid method to generate subrepo diverged promptchoice
Angel Ezquerra <angel.ezquerra@gmail.com>
parents:
21024
diff
changeset
|
593 subrepository s diverged (local revision: 32a3438, remote revision: 32a3438) |
30060
a145161debed
merge: use labels in subrepo merge
Simon Farnsworth <simonfar@fb.com>
parents:
29328
diff
changeset
|
594 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m |
13417
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
595 subrepository sources for s differ |
22590
d4c972b97fee
subrepo: remove superfluous newline from subrepo prompt
Mads Kiilerich <madski@unity3d.com>
parents:
22046
diff
changeset
|
596 use (l)ocal source (32a3438) or (r)emote source (32a3438)? l |
13417
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
597 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
598 $ hg id -n |
17255
3e856d8abe9c
identity: show trailing '+' for dirty subrepos (issue2839)
Patrick Mezard <patrick@mezard.eu>
parents:
17114
diff
changeset
|
599 7+ |
13417
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
600 $ cd s |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
601 $ git rev-parse HEAD |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
602 aa84837ccfbdfedcdcdeeedc309d73e6eb069edc |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
603 $ cd .. |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
604 |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
605 Sticky repository, update --clean |
16264
0628290d98df
tests: ignore git's output in test-subrepo-git.t
Javi Merino <cibervicho@gmail.com>
parents:
15531
diff
changeset
|
606 $ hg update --clean tip 2>/dev/null |
13417
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
607 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
608 $ hg id -n |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
609 7 |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
610 $ cd s |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
611 $ git rev-parse HEAD |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
612 32a343883b74769118bb1d3b4b1fbf9156f4dddc |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
613 $ cd .. |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
614 |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
615 Test subrepo already at intended revision: |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
616 $ cd s |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
617 $ git checkout 32a343883b74769118bb1d3b4b1fbf9156f4dddc |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
618 HEAD is now at 32a3438... fff |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
619 $ cd .. |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
620 $ hg update 1 |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
621 Previous HEAD position was 32a3438... fff |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
622 HEAD is now at da5f5b1... g |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
623 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
624 $ hg id -n |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
625 1 |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
626 $ cd s |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
627 $ git rev-parse HEAD |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
628 da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7 |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
629 $ cd .. |
0748e18be470
subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents:
13331
diff
changeset
|
630 |
16527
17a1f7690b49
subrepo: fix default implementation of forget() (issue3404)
Patrick Mezard <patrick@mezard.eu>
parents:
16271
diff
changeset
|
631 Test forgetting files, not implemented in git subrepo, used to |
17a1f7690b49
subrepo: fix default implementation of forget() (issue3404)
Patrick Mezard <patrick@mezard.eu>
parents:
16271
diff
changeset
|
632 traceback |
17022
8a38839ae1dc
test-subrepo-git.t: adapt for Windows
Eduard-Cristian Stefan <alexandrul.ct@gmail.com>
parents:
16913
diff
changeset
|
633 #if no-windows |
16527
17a1f7690b49
subrepo: fix default implementation of forget() (issue3404)
Patrick Mezard <patrick@mezard.eu>
parents:
16271
diff
changeset
|
634 $ hg forget 'notafile*' |
17a1f7690b49
subrepo: fix default implementation of forget() (issue3404)
Patrick Mezard <patrick@mezard.eu>
parents:
16271
diff
changeset
|
635 notafile*: No such file or directory |
17a1f7690b49
subrepo: fix default implementation of forget() (issue3404)
Patrick Mezard <patrick@mezard.eu>
parents:
16271
diff
changeset
|
636 [1] |
17022
8a38839ae1dc
test-subrepo-git.t: adapt for Windows
Eduard-Cristian Stefan <alexandrul.ct@gmail.com>
parents:
16913
diff
changeset
|
637 #else |
8a38839ae1dc
test-subrepo-git.t: adapt for Windows
Eduard-Cristian Stefan <alexandrul.ct@gmail.com>
parents:
16913
diff
changeset
|
638 $ hg forget 'notafile' |
8a38839ae1dc
test-subrepo-git.t: adapt for Windows
Eduard-Cristian Stefan <alexandrul.ct@gmail.com>
parents:
16913
diff
changeset
|
639 notafile: * (glob) |
8a38839ae1dc
test-subrepo-git.t: adapt for Windows
Eduard-Cristian Stefan <alexandrul.ct@gmail.com>
parents:
16913
diff
changeset
|
640 [1] |
8a38839ae1dc
test-subrepo-git.t: adapt for Windows
Eduard-Cristian Stefan <alexandrul.ct@gmail.com>
parents:
16913
diff
changeset
|
641 #endif |
16913
f2719b387380
tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents:
16527
diff
changeset
|
642 |
f2719b387380
tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents:
16527
diff
changeset
|
643 $ cd .. |
21564
2e91d4964ecd
subrepo: make "_sanitize()" work
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21024
diff
changeset
|
644 |
2e91d4964ecd
subrepo: make "_sanitize()" work
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21024
diff
changeset
|
645 Test sanitizing ".hg/hgrc" in subrepo |
2e91d4964ecd
subrepo: make "_sanitize()" work
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21024
diff
changeset
|
646 |
2e91d4964ecd
subrepo: make "_sanitize()" work
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21024
diff
changeset
|
647 $ cd t |
2e91d4964ecd
subrepo: make "_sanitize()" work
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21024
diff
changeset
|
648 $ hg tip -q |
2e91d4964ecd
subrepo: make "_sanitize()" work
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21024
diff
changeset
|
649 7:af6d2edbb0d3 |
2e91d4964ecd
subrepo: make "_sanitize()" work
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21024
diff
changeset
|
650 $ hg update -q -C af6d2edbb0d3 |
2e91d4964ecd
subrepo: make "_sanitize()" work
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21024
diff
changeset
|
651 $ cd s |
2e91d4964ecd
subrepo: make "_sanitize()" work
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21024
diff
changeset
|
652 $ git checkout -q -b sanitize-test |
2e91d4964ecd
subrepo: make "_sanitize()" work
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21024
diff
changeset
|
653 $ mkdir .hg |
2e91d4964ecd
subrepo: make "_sanitize()" work
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21024
diff
changeset
|
654 $ echo '.hg/hgrc in git repo' > .hg/hgrc |
2e91d4964ecd
subrepo: make "_sanitize()" work
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21024
diff
changeset
|
655 $ mkdir -p sub/.hg |
2e91d4964ecd
subrepo: make "_sanitize()" work
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21024
diff
changeset
|
656 $ echo 'sub/.hg/hgrc in git repo' > sub/.hg/hgrc |
2e91d4964ecd
subrepo: make "_sanitize()" work
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21024
diff
changeset
|
657 $ git add .hg sub |
2e91d4964ecd
subrepo: make "_sanitize()" work
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21024
diff
changeset
|
658 $ git commit -qm 'add .hg/hgrc to be sanitized at hg update' |
2e91d4964ecd
subrepo: make "_sanitize()" work
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21024
diff
changeset
|
659 $ git push -q origin sanitize-test |
2e91d4964ecd
subrepo: make "_sanitize()" work
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21024
diff
changeset
|
660 $ cd .. |
2e91d4964ecd
subrepo: make "_sanitize()" work
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21024
diff
changeset
|
661 $ grep ' s$' .hgsubstate |
2e91d4964ecd
subrepo: make "_sanitize()" work
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21024
diff
changeset
|
662 32a343883b74769118bb1d3b4b1fbf9156f4dddc s |
2e91d4964ecd
subrepo: make "_sanitize()" work
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21024
diff
changeset
|
663 $ hg commit -qm 'commit with git revision including .hg/hgrc' |
2e91d4964ecd
subrepo: make "_sanitize()" work
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21024
diff
changeset
|
664 $ hg parents -q |
2e91d4964ecd
subrepo: make "_sanitize()" work
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21024
diff
changeset
|
665 8:3473d20bddcf |
2e91d4964ecd
subrepo: make "_sanitize()" work
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21024
diff
changeset
|
666 $ grep ' s$' .hgsubstate |
2e91d4964ecd
subrepo: make "_sanitize()" work
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21024
diff
changeset
|
667 c4069473b459cf27fd4d7c2f50c4346b4e936599 s |
2e91d4964ecd
subrepo: make "_sanitize()" work
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21024
diff
changeset
|
668 $ cd .. |
2e91d4964ecd
subrepo: make "_sanitize()" work
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21024
diff
changeset
|
669 |
21566
a01988cd9b61
subrepo: make "_sanitize()" take absolute path to the root of subrepo
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21565
diff
changeset
|
670 $ hg -R tc pull -q |
a01988cd9b61
subrepo: make "_sanitize()" take absolute path to the root of subrepo
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21565
diff
changeset
|
671 $ hg -R tc update -q -C 3473d20bddcf 2>&1 | sort |
a01988cd9b61
subrepo: make "_sanitize()" take absolute path to the root of subrepo
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21565
diff
changeset
|
672 warning: removing potentially hostile 'hgrc' in '$TESTTMP/tc/s/.hg' (glob) |
a01988cd9b61
subrepo: make "_sanitize()" take absolute path to the root of subrepo
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21565
diff
changeset
|
673 warning: removing potentially hostile 'hgrc' in '$TESTTMP/tc/s/sub/.hg' (glob) |
21564
2e91d4964ecd
subrepo: make "_sanitize()" work
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21024
diff
changeset
|
674 $ cd tc |
2e91d4964ecd
subrepo: make "_sanitize()" work
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21024
diff
changeset
|
675 $ hg parents -q |
2e91d4964ecd
subrepo: make "_sanitize()" work
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21024
diff
changeset
|
676 8:3473d20bddcf |
2e91d4964ecd
subrepo: make "_sanitize()" work
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21024
diff
changeset
|
677 $ grep ' s$' .hgsubstate |
2e91d4964ecd
subrepo: make "_sanitize()" work
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21024
diff
changeset
|
678 c4069473b459cf27fd4d7c2f50c4346b4e936599 s |
21748
8621125a1718
tests: cat error messages are different on Solaris
Danek Duvall <danek.duvall@oracle.com>
parents:
21567
diff
changeset
|
679 $ test -f s/.hg/hgrc |
21564
2e91d4964ecd
subrepo: make "_sanitize()" work
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21024
diff
changeset
|
680 [1] |
21748
8621125a1718
tests: cat error messages are different on Solaris
Danek Duvall <danek.duvall@oracle.com>
parents:
21567
diff
changeset
|
681 $ test -f s/sub/.hg/hgrc |
21564
2e91d4964ecd
subrepo: make "_sanitize()" work
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21024
diff
changeset
|
682 [1] |
2e91d4964ecd
subrepo: make "_sanitize()" work
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21024
diff
changeset
|
683 $ cd .. |
21565
7f7f634d073d
subrepo: invoke "_sanitize()" also after "git merge --ff"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21564
diff
changeset
|
684 |
7f7f634d073d
subrepo: invoke "_sanitize()" also after "git merge --ff"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21564
diff
changeset
|
685 additional test for "git merge --ff" route: |
7f7f634d073d
subrepo: invoke "_sanitize()" also after "git merge --ff"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21564
diff
changeset
|
686 |
7f7f634d073d
subrepo: invoke "_sanitize()" also after "git merge --ff"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21564
diff
changeset
|
687 $ cd t |
7f7f634d073d
subrepo: invoke "_sanitize()" also after "git merge --ff"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21564
diff
changeset
|
688 $ hg tip -q |
7f7f634d073d
subrepo: invoke "_sanitize()" also after "git merge --ff"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21564
diff
changeset
|
689 8:3473d20bddcf |
7f7f634d073d
subrepo: invoke "_sanitize()" also after "git merge --ff"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21564
diff
changeset
|
690 $ hg update -q -C af6d2edbb0d3 |
7f7f634d073d
subrepo: invoke "_sanitize()" also after "git merge --ff"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21564
diff
changeset
|
691 $ cd s |
7f7f634d073d
subrepo: invoke "_sanitize()" also after "git merge --ff"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21564
diff
changeset
|
692 $ git checkout -q testing |
7f7f634d073d
subrepo: invoke "_sanitize()" also after "git merge --ff"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21564
diff
changeset
|
693 $ mkdir .hg |
7f7f634d073d
subrepo: invoke "_sanitize()" also after "git merge --ff"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21564
diff
changeset
|
694 $ echo '.hg/hgrc in git repo' > .hg/hgrc |
7f7f634d073d
subrepo: invoke "_sanitize()" also after "git merge --ff"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21564
diff
changeset
|
695 $ mkdir -p sub/.hg |
7f7f634d073d
subrepo: invoke "_sanitize()" also after "git merge --ff"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21564
diff
changeset
|
696 $ echo 'sub/.hg/hgrc in git repo' > sub/.hg/hgrc |
7f7f634d073d
subrepo: invoke "_sanitize()" also after "git merge --ff"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21564
diff
changeset
|
697 $ git add .hg sub |
7f7f634d073d
subrepo: invoke "_sanitize()" also after "git merge --ff"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21564
diff
changeset
|
698 $ git commit -qm 'add .hg/hgrc to be sanitized at hg update (git merge --ff)' |
7f7f634d073d
subrepo: invoke "_sanitize()" also after "git merge --ff"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21564
diff
changeset
|
699 $ git push -q origin testing |
7f7f634d073d
subrepo: invoke "_sanitize()" also after "git merge --ff"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21564
diff
changeset
|
700 $ cd .. |
7f7f634d073d
subrepo: invoke "_sanitize()" also after "git merge --ff"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21564
diff
changeset
|
701 $ grep ' s$' .hgsubstate |
7f7f634d073d
subrepo: invoke "_sanitize()" also after "git merge --ff"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21564
diff
changeset
|
702 32a343883b74769118bb1d3b4b1fbf9156f4dddc s |
7f7f634d073d
subrepo: invoke "_sanitize()" also after "git merge --ff"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21564
diff
changeset
|
703 $ hg commit -qm 'commit with git revision including .hg/hgrc' |
7f7f634d073d
subrepo: invoke "_sanitize()" also after "git merge --ff"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21564
diff
changeset
|
704 $ hg parents -q |
7f7f634d073d
subrepo: invoke "_sanitize()" also after "git merge --ff"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21564
diff
changeset
|
705 9:ed23f7fe024e |
7f7f634d073d
subrepo: invoke "_sanitize()" also after "git merge --ff"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21564
diff
changeset
|
706 $ grep ' s$' .hgsubstate |
7f7f634d073d
subrepo: invoke "_sanitize()" also after "git merge --ff"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21564
diff
changeset
|
707 f262643c1077219fbd3858d54e78ef050ef84fbf s |
7f7f634d073d
subrepo: invoke "_sanitize()" also after "git merge --ff"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21564
diff
changeset
|
708 $ cd .. |
7f7f634d073d
subrepo: invoke "_sanitize()" also after "git merge --ff"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21564
diff
changeset
|
709 |
7f7f634d073d
subrepo: invoke "_sanitize()" also after "git merge --ff"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21564
diff
changeset
|
710 $ cd tc |
7f7f634d073d
subrepo: invoke "_sanitize()" also after "git merge --ff"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21564
diff
changeset
|
711 $ hg update -q -C af6d2edbb0d3 |
21748
8621125a1718
tests: cat error messages are different on Solaris
Danek Duvall <danek.duvall@oracle.com>
parents:
21567
diff
changeset
|
712 $ test -f s/.hg/hgrc |
21565
7f7f634d073d
subrepo: invoke "_sanitize()" also after "git merge --ff"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21564
diff
changeset
|
713 [1] |
21748
8621125a1718
tests: cat error messages are different on Solaris
Danek Duvall <danek.duvall@oracle.com>
parents:
21567
diff
changeset
|
714 $ test -f s/sub/.hg/hgrc |
21565
7f7f634d073d
subrepo: invoke "_sanitize()" also after "git merge --ff"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21564
diff
changeset
|
715 [1] |
21566
a01988cd9b61
subrepo: make "_sanitize()" take absolute path to the root of subrepo
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21565
diff
changeset
|
716 $ cd .. |
a01988cd9b61
subrepo: make "_sanitize()" take absolute path to the root of subrepo
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21565
diff
changeset
|
717 $ hg -R tc pull -q |
a01988cd9b61
subrepo: make "_sanitize()" take absolute path to the root of subrepo
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21565
diff
changeset
|
718 $ hg -R tc update -q -C ed23f7fe024e 2>&1 | sort |
a01988cd9b61
subrepo: make "_sanitize()" take absolute path to the root of subrepo
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21565
diff
changeset
|
719 warning: removing potentially hostile 'hgrc' in '$TESTTMP/tc/s/.hg' (glob) |
a01988cd9b61
subrepo: make "_sanitize()" take absolute path to the root of subrepo
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21565
diff
changeset
|
720 warning: removing potentially hostile 'hgrc' in '$TESTTMP/tc/s/sub/.hg' (glob) |
a01988cd9b61
subrepo: make "_sanitize()" take absolute path to the root of subrepo
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21565
diff
changeset
|
721 $ cd tc |
21565
7f7f634d073d
subrepo: invoke "_sanitize()" also after "git merge --ff"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21564
diff
changeset
|
722 $ hg parents -q |
7f7f634d073d
subrepo: invoke "_sanitize()" also after "git merge --ff"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21564
diff
changeset
|
723 9:ed23f7fe024e |
7f7f634d073d
subrepo: invoke "_sanitize()" also after "git merge --ff"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21564
diff
changeset
|
724 $ grep ' s$' .hgsubstate |
7f7f634d073d
subrepo: invoke "_sanitize()" also after "git merge --ff"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21564
diff
changeset
|
725 f262643c1077219fbd3858d54e78ef050ef84fbf s |
21748
8621125a1718
tests: cat error messages are different on Solaris
Danek Duvall <danek.duvall@oracle.com>
parents:
21567
diff
changeset
|
726 $ test -f s/.hg/hgrc |
21565
7f7f634d073d
subrepo: invoke "_sanitize()" also after "git merge --ff"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21564
diff
changeset
|
727 [1] |
21748
8621125a1718
tests: cat error messages are different on Solaris
Danek Duvall <danek.duvall@oracle.com>
parents:
21567
diff
changeset
|
728 $ test -f s/sub/.hg/hgrc |
21565
7f7f634d073d
subrepo: invoke "_sanitize()" also after "git merge --ff"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21564
diff
changeset
|
729 [1] |
21567
5900bc09e684
subrepo: avoid sanitizing ".hg/hgrc" in meta data area for non-hg subrepos
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21566
diff
changeset
|
730 |
5900bc09e684
subrepo: avoid sanitizing ".hg/hgrc" in meta data area for non-hg subrepos
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21566
diff
changeset
|
731 Test that sanitizing is omitted in meta data area: |
5900bc09e684
subrepo: avoid sanitizing ".hg/hgrc" in meta data area for non-hg subrepos
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21566
diff
changeset
|
732 |
5900bc09e684
subrepo: avoid sanitizing ".hg/hgrc" in meta data area for non-hg subrepos
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21566
diff
changeset
|
733 $ mkdir s/.git/.hg |
5900bc09e684
subrepo: avoid sanitizing ".hg/hgrc" in meta data area for non-hg subrepos
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21566
diff
changeset
|
734 $ echo '.hg/hgrc in git metadata area' > s/.git/.hg/hgrc |
5900bc09e684
subrepo: avoid sanitizing ".hg/hgrc" in meta data area for non-hg subrepos
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21566
diff
changeset
|
735 $ hg update -q -C af6d2edbb0d3 |
33365
6d88468d435b
subrepo: make the output references to subrepositories consistent
Matt Harbison <matt_harbison@yahoo.com>
parents:
32902
diff
changeset
|
736 checking out detached HEAD in subrepository "s" |
21567
5900bc09e684
subrepo: avoid sanitizing ".hg/hgrc" in meta data area for non-hg subrepos
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21566
diff
changeset
|
737 check out a git branch if you intend to make changes |
5900bc09e684
subrepo: avoid sanitizing ".hg/hgrc" in meta data area for non-hg subrepos
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21566
diff
changeset
|
738 |
23523
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
739 check differences made by most recent change |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
740 $ cd s |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
741 $ cat > foobar << EOF |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
742 > woopwoop |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
743 > |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
744 > foo |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
745 > bar |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
746 > EOF |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
747 $ git add foobar |
21565
7f7f634d073d
subrepo: invoke "_sanitize()" also after "git merge --ff"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21564
diff
changeset
|
748 $ cd .. |
23523
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
749 |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
750 $ hg diff --subrepos |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
751 diff --git a/s/foobar b/s/foobar |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
752 new file mode 100644 |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
753 index 0000000..8a5a5e2 |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
754 --- /dev/null |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
755 +++ b/s/foobar |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
756 @@ -0,0 +1,4 @@ |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
757 +woopwoop |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
758 + |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
759 +foo |
23938
de519517f597
subrepo: correctly add newline for git subrepo diffs
Mathias De Maré <mathias.demare@gmail.com>
parents:
23937
diff
changeset
|
760 +bar |
23523
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
761 |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
762 $ hg commit --subrepos -m "Added foobar" |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
763 committing subrepository s |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
764 created new head |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
765 |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
766 $ hg diff -c . --subrepos --nodates |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
767 diff -r af6d2edbb0d3 -r 255ee8cf690e .hgsubstate |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
768 --- a/.hgsubstate |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
769 +++ b/.hgsubstate |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
770 @@ -1,1 +1,1 @@ |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
771 -32a343883b74769118bb1d3b4b1fbf9156f4dddc s |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
772 +fd4dbf828a5b2fcd36b2bcf21ea773820970d129 s |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
773 diff --git a/s/foobar b/s/foobar |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
774 new file mode 100644 |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
775 index 0000000..8a5a5e2 |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
776 --- /dev/null |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
777 +++ b/s/foobar |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
778 @@ -0,0 +1,4 @@ |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
779 +woopwoop |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
780 + |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
781 +foo |
23938
de519517f597
subrepo: correctly add newline for git subrepo diffs
Mathias De Maré <mathias.demare@gmail.com>
parents:
23937
diff
changeset
|
782 +bar |
23523
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
783 |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
784 check output when only diffing the subrepository |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
785 $ hg diff -c . --subrepos s |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
786 diff --git a/s/foobar b/s/foobar |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
787 new file mode 100644 |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
788 index 0000000..8a5a5e2 |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
789 --- /dev/null |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
790 +++ b/s/foobar |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
791 @@ -0,0 +1,4 @@ |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
792 +woopwoop |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
793 + |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
794 +foo |
23938
de519517f597
subrepo: correctly add newline for git subrepo diffs
Mathias De Maré <mathias.demare@gmail.com>
parents:
23937
diff
changeset
|
795 +bar |
23523
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
796 |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
797 check output when diffing something else |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
798 $ hg diff -c . --subrepos .hgsubstate --nodates |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
799 diff -r af6d2edbb0d3 -r 255ee8cf690e .hgsubstate |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
800 --- a/.hgsubstate |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
801 +++ b/.hgsubstate |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
802 @@ -1,1 +1,1 @@ |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
803 -32a343883b74769118bb1d3b4b1fbf9156f4dddc s |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
804 +fd4dbf828a5b2fcd36b2bcf21ea773820970d129 s |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
805 |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
806 add new changes, including whitespace |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
807 $ cd s |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
808 $ cat > foobar << EOF |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
809 > woop woop |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
810 > |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
811 > foo |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
812 > bar |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
813 > EOF |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
814 $ echo foo > barfoo |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
815 $ git add barfoo |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
816 $ cd .. |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
817 |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
818 $ hg diff --subrepos --ignore-all-space |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
819 diff --git a/s/barfoo b/s/barfoo |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
820 new file mode 100644 |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
821 index 0000000..257cc56 |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
822 --- /dev/null |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
823 +++ b/s/barfoo |
28035
c65da6892ae5
tests: make chunk header of external diff glob-ed for portability
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
26969
diff
changeset
|
824 @@ -0,0 +1* @@ (glob) |
23938
de519517f597
subrepo: correctly add newline for git subrepo diffs
Mathias De Maré <mathias.demare@gmail.com>
parents:
23937
diff
changeset
|
825 +foo |
23523
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
826 $ hg diff --subrepos s/foobar |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
827 diff --git a/s/foobar b/s/foobar |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
828 index 8a5a5e2..bd5812a 100644 |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
829 --- a/s/foobar |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
830 +++ b/s/foobar |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
831 @@ -1,4 +1,4 @@ |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
832 -woopwoop |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
833 +woop woop |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
834 |
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
835 foo |
23938
de519517f597
subrepo: correctly add newline for git subrepo diffs
Mathias De Maré <mathias.demare@gmail.com>
parents:
23937
diff
changeset
|
836 bar |
23523
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
837 |
23542
8b5adc6b72ae
tests: allow more flexibility in git diffstat output
Mathias De Maré <mathias.demare@gmail.com>
parents:
23523
diff
changeset
|
838 execute a diffstat |
8b5adc6b72ae
tests: allow more flexibility in git diffstat output
Mathias De Maré <mathias.demare@gmail.com>
parents:
23523
diff
changeset
|
839 the output contains a regex, because git 1.7.10 and 1.7.11 |
8b5adc6b72ae
tests: allow more flexibility in git diffstat output
Mathias De Maré <mathias.demare@gmail.com>
parents:
23523
diff
changeset
|
840 change the amount of whitespace |
23523
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
841 $ hg diff --subrepos --stat |
23542
8b5adc6b72ae
tests: allow more flexibility in git diffstat output
Mathias De Maré <mathias.demare@gmail.com>
parents:
23523
diff
changeset
|
842 \s*barfoo |\s*1 + (re) |
8b5adc6b72ae
tests: allow more flexibility in git diffstat output
Mathias De Maré <mathias.demare@gmail.com>
parents:
23523
diff
changeset
|
843 \s*foobar |\s*2 +- (re) |
23938
de519517f597
subrepo: correctly add newline for git subrepo diffs
Mathias De Maré <mathias.demare@gmail.com>
parents:
23937
diff
changeset
|
844 2 files changed, 2 insertions\(\+\), 1 deletions?\(-\) (re) |
23523
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
845 |
24778
a48b65ab428d
subrepo: add include/exclude support for diffing git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24581
diff
changeset
|
846 adding an include should ignore the other elements |
23523
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
847 $ hg diff --subrepos -I s/foobar |
24778
a48b65ab428d
subrepo: add include/exclude support for diffing git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24581
diff
changeset
|
848 diff --git a/s/foobar b/s/foobar |
a48b65ab428d
subrepo: add include/exclude support for diffing git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24581
diff
changeset
|
849 index 8a5a5e2..bd5812a 100644 |
a48b65ab428d
subrepo: add include/exclude support for diffing git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24581
diff
changeset
|
850 --- a/s/foobar |
a48b65ab428d
subrepo: add include/exclude support for diffing git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24581
diff
changeset
|
851 +++ b/s/foobar |
a48b65ab428d
subrepo: add include/exclude support for diffing git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24581
diff
changeset
|
852 @@ -1,4 +1,4 @@ |
a48b65ab428d
subrepo: add include/exclude support for diffing git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24581
diff
changeset
|
853 -woopwoop |
a48b65ab428d
subrepo: add include/exclude support for diffing git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24581
diff
changeset
|
854 +woop woop |
a48b65ab428d
subrepo: add include/exclude support for diffing git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24581
diff
changeset
|
855 |
a48b65ab428d
subrepo: add include/exclude support for diffing git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24581
diff
changeset
|
856 foo |
a48b65ab428d
subrepo: add include/exclude support for diffing git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24581
diff
changeset
|
857 bar |
a48b65ab428d
subrepo: add include/exclude support for diffing git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24581
diff
changeset
|
858 |
a48b65ab428d
subrepo: add include/exclude support for diffing git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24581
diff
changeset
|
859 adding an exclude should ignore this element |
23523
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
860 $ hg diff --subrepos -X s/foobar |
24778
a48b65ab428d
subrepo: add include/exclude support for diffing git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24581
diff
changeset
|
861 diff --git a/s/barfoo b/s/barfoo |
a48b65ab428d
subrepo: add include/exclude support for diffing git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24581
diff
changeset
|
862 new file mode 100644 |
a48b65ab428d
subrepo: add include/exclude support for diffing git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24581
diff
changeset
|
863 index 0000000..257cc56 |
a48b65ab428d
subrepo: add include/exclude support for diffing git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24581
diff
changeset
|
864 --- /dev/null |
a48b65ab428d
subrepo: add include/exclude support for diffing git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24581
diff
changeset
|
865 +++ b/s/barfoo |
28035
c65da6892ae5
tests: make chunk header of external diff glob-ed for portability
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
26969
diff
changeset
|
866 @@ -0,0 +1* @@ (glob) |
24778
a48b65ab428d
subrepo: add include/exclude support for diffing git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24581
diff
changeset
|
867 +foo |
a48b65ab428d
subrepo: add include/exclude support for diffing git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24581
diff
changeset
|
868 |
a48b65ab428d
subrepo: add include/exclude support for diffing git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24581
diff
changeset
|
869 moving a file should show a removal and an add |
a48b65ab428d
subrepo: add include/exclude support for diffing git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24581
diff
changeset
|
870 $ hg revert --all |
a48b65ab428d
subrepo: add include/exclude support for diffing git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24581
diff
changeset
|
871 reverting subrepo ../gitroot |
a48b65ab428d
subrepo: add include/exclude support for diffing git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24581
diff
changeset
|
872 $ cd s |
a48b65ab428d
subrepo: add include/exclude support for diffing git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24581
diff
changeset
|
873 $ git mv foobar woop |
a48b65ab428d
subrepo: add include/exclude support for diffing git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24581
diff
changeset
|
874 $ cd .. |
a48b65ab428d
subrepo: add include/exclude support for diffing git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24581
diff
changeset
|
875 $ hg diff --subrepos |
a48b65ab428d
subrepo: add include/exclude support for diffing git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24581
diff
changeset
|
876 diff --git a/s/foobar b/s/foobar |
a48b65ab428d
subrepo: add include/exclude support for diffing git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24581
diff
changeset
|
877 deleted file mode 100644 |
a48b65ab428d
subrepo: add include/exclude support for diffing git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24581
diff
changeset
|
878 index 8a5a5e2..0000000 |
a48b65ab428d
subrepo: add include/exclude support for diffing git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24581
diff
changeset
|
879 --- a/s/foobar |
a48b65ab428d
subrepo: add include/exclude support for diffing git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24581
diff
changeset
|
880 +++ /dev/null |
a48b65ab428d
subrepo: add include/exclude support for diffing git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24581
diff
changeset
|
881 @@ -1,4 +0,0 @@ |
a48b65ab428d
subrepo: add include/exclude support for diffing git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24581
diff
changeset
|
882 -woopwoop |
a48b65ab428d
subrepo: add include/exclude support for diffing git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24581
diff
changeset
|
883 - |
a48b65ab428d
subrepo: add include/exclude support for diffing git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24581
diff
changeset
|
884 -foo |
a48b65ab428d
subrepo: add include/exclude support for diffing git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24581
diff
changeset
|
885 -bar |
a48b65ab428d
subrepo: add include/exclude support for diffing git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24581
diff
changeset
|
886 diff --git a/s/woop b/s/woop |
a48b65ab428d
subrepo: add include/exclude support for diffing git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24581
diff
changeset
|
887 new file mode 100644 |
a48b65ab428d
subrepo: add include/exclude support for diffing git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24581
diff
changeset
|
888 index 0000000..8a5a5e2 |
a48b65ab428d
subrepo: add include/exclude support for diffing git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24581
diff
changeset
|
889 --- /dev/null |
a48b65ab428d
subrepo: add include/exclude support for diffing git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24581
diff
changeset
|
890 +++ b/s/woop |
a48b65ab428d
subrepo: add include/exclude support for diffing git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24581
diff
changeset
|
891 @@ -0,0 +1,4 @@ |
a48b65ab428d
subrepo: add include/exclude support for diffing git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24581
diff
changeset
|
892 +woopwoop |
a48b65ab428d
subrepo: add include/exclude support for diffing git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24581
diff
changeset
|
893 + |
a48b65ab428d
subrepo: add include/exclude support for diffing git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24581
diff
changeset
|
894 +foo |
a48b65ab428d
subrepo: add include/exclude support for diffing git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24581
diff
changeset
|
895 +bar |
a48b65ab428d
subrepo: add include/exclude support for diffing git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24581
diff
changeset
|
896 $ rm s/woop |
23523
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
897 |
23550
7fa2189c1e87
subrepo: add revert support without backup for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23542
diff
changeset
|
898 revert the subrepository |
7fa2189c1e87
subrepo: add revert support without backup for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23542
diff
changeset
|
899 $ hg revert --all |
23937
fd5b9417d315
tests: discard useless "(glob)" in "reverting subrepo" lines
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
23693
diff
changeset
|
900 reverting subrepo ../gitroot |
23550
7fa2189c1e87
subrepo: add revert support without backup for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23542
diff
changeset
|
901 |
7fa2189c1e87
subrepo: add revert support without backup for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23542
diff
changeset
|
902 $ hg status --subrepos |
23678
194d2f185008
subrepo: add full revert support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23551
diff
changeset
|
903 ? s/barfoo |
194d2f185008
subrepo: add full revert support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23551
diff
changeset
|
904 ? s/foobar.orig |
23550
7fa2189c1e87
subrepo: add revert support without backup for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23542
diff
changeset
|
905 |
23678
194d2f185008
subrepo: add full revert support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23551
diff
changeset
|
906 $ mv s/foobar.orig s/foobar |
194d2f185008
subrepo: add full revert support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23551
diff
changeset
|
907 |
23550
7fa2189c1e87
subrepo: add revert support without backup for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23542
diff
changeset
|
908 $ hg revert --no-backup s |
23937
fd5b9417d315
tests: discard useless "(glob)" in "reverting subrepo" lines
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
23693
diff
changeset
|
909 reverting subrepo ../gitroot |
23550
7fa2189c1e87
subrepo: add revert support without backup for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23542
diff
changeset
|
910 |
7fa2189c1e87
subrepo: add revert support without backup for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23542
diff
changeset
|
911 $ hg status --subrepos |
7fa2189c1e87
subrepo: add revert support without backup for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23542
diff
changeset
|
912 ? s/barfoo |
7fa2189c1e87
subrepo: add revert support without backup for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23542
diff
changeset
|
913 |
26940
91786f20db83
git-subrepos: revert respects specified location to save .orig files
Christian Delahousse <cdelahousse@fb.com>
parents:
24964
diff
changeset
|
914 revert moves orig files to the right place |
91786f20db83
git-subrepos: revert respects specified location to save .orig files
Christian Delahousse <cdelahousse@fb.com>
parents:
24964
diff
changeset
|
915 $ echo 'bloop' > s/foobar |
91786f20db83
git-subrepos: revert respects specified location to save .orig files
Christian Delahousse <cdelahousse@fb.com>
parents:
24964
diff
changeset
|
916 $ hg revert --all --verbose --config 'ui.origbackuppath=.hg/origbackups' |
91786f20db83
git-subrepos: revert respects specified location to save .orig files
Christian Delahousse <cdelahousse@fb.com>
parents:
24964
diff
changeset
|
917 reverting subrepo ../gitroot |
26969
b54b520a24c2
tests: fix globs for Windows
Matt Harbison <matt_harbison@yahoo.com>
parents:
26940
diff
changeset
|
918 creating directory: $TESTTMP/tc/.hg/origbackups (glob) |
34146
9e4f82bc2b0b
scmutil: don't append .orig to backups in origbackuppath (BC)
Mark Thomas <mbthomas@fb.com>
parents:
33660
diff
changeset
|
919 saving current version of foobar as $TESTTMP/tc/.hg/origbackups/foobar (glob) |
26940
91786f20db83
git-subrepos: revert respects specified location to save .orig files
Christian Delahousse <cdelahousse@fb.com>
parents:
24964
diff
changeset
|
920 $ ls .hg/origbackups |
34146
9e4f82bc2b0b
scmutil: don't append .orig to backups in origbackuppath (BC)
Mark Thomas <mbthomas@fb.com>
parents:
33660
diff
changeset
|
921 foobar |
26940
91786f20db83
git-subrepos: revert respects specified location to save .orig files
Christian Delahousse <cdelahousse@fb.com>
parents:
24964
diff
changeset
|
922 $ rm -rf .hg/origbackups |
91786f20db83
git-subrepos: revert respects specified location to save .orig files
Christian Delahousse <cdelahousse@fb.com>
parents:
24964
diff
changeset
|
923 |
23991
07c1a7d1ef69
subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23963
diff
changeset
|
924 show file at specific revision |
07c1a7d1ef69
subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23963
diff
changeset
|
925 $ cat > s/foobar << EOF |
07c1a7d1ef69
subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23963
diff
changeset
|
926 > woop woop |
07c1a7d1ef69
subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23963
diff
changeset
|
927 > fooo bar |
07c1a7d1ef69
subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23963
diff
changeset
|
928 > EOF |
07c1a7d1ef69
subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23963
diff
changeset
|
929 $ hg commit --subrepos -m "updated foobar" |
07c1a7d1ef69
subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23963
diff
changeset
|
930 committing subrepository s |
07c1a7d1ef69
subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23963
diff
changeset
|
931 $ cat > s/foobar << EOF |
07c1a7d1ef69
subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23963
diff
changeset
|
932 > current foobar |
07c1a7d1ef69
subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23963
diff
changeset
|
933 > (should not be visible using hg cat) |
07c1a7d1ef69
subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23963
diff
changeset
|
934 > EOF |
07c1a7d1ef69
subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23963
diff
changeset
|
935 |
07c1a7d1ef69
subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23963
diff
changeset
|
936 $ hg cat -r . s/foobar |
07c1a7d1ef69
subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23963
diff
changeset
|
937 woop woop |
07c1a7d1ef69
subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23963
diff
changeset
|
938 fooo bar (no-eol) |
07c1a7d1ef69
subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23963
diff
changeset
|
939 $ hg cat -r "parents(.)" s/foobar > catparents |
07c1a7d1ef69
subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23963
diff
changeset
|
940 |
07c1a7d1ef69
subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23963
diff
changeset
|
941 $ mkdir -p tmp/s |
07c1a7d1ef69
subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23963
diff
changeset
|
942 |
07c1a7d1ef69
subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23963
diff
changeset
|
943 $ hg cat -r "parents(.)" --output tmp/%% s/foobar |
07c1a7d1ef69
subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23963
diff
changeset
|
944 $ diff tmp/% catparents |
07c1a7d1ef69
subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23963
diff
changeset
|
945 |
07c1a7d1ef69
subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23963
diff
changeset
|
946 $ hg cat -r "parents(.)" --output tmp/%s s/foobar |
07c1a7d1ef69
subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23963
diff
changeset
|
947 $ diff tmp/foobar catparents |
07c1a7d1ef69
subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23963
diff
changeset
|
948 |
07c1a7d1ef69
subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23963
diff
changeset
|
949 $ hg cat -r "parents(.)" --output tmp/%d/otherfoobar s/foobar |
07c1a7d1ef69
subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23963
diff
changeset
|
950 $ diff tmp/s/otherfoobar catparents |
07c1a7d1ef69
subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23963
diff
changeset
|
951 |
07c1a7d1ef69
subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23963
diff
changeset
|
952 $ hg cat -r "parents(.)" --output tmp/%p s/foobar |
07c1a7d1ef69
subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23963
diff
changeset
|
953 $ diff tmp/s/foobar catparents |
07c1a7d1ef69
subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23963
diff
changeset
|
954 |
07c1a7d1ef69
subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23963
diff
changeset
|
955 $ hg cat -r "parents(.)" --output tmp/%H s/foobar |
07c1a7d1ef69
subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23963
diff
changeset
|
956 $ diff tmp/255ee8cf690ec86e99b1e80147ea93ece117cd9d catparents |
07c1a7d1ef69
subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23963
diff
changeset
|
957 |
07c1a7d1ef69
subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23963
diff
changeset
|
958 $ hg cat -r "parents(.)" --output tmp/%R s/foobar |
07c1a7d1ef69
subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23963
diff
changeset
|
959 $ diff tmp/10 catparents |
07c1a7d1ef69
subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23963
diff
changeset
|
960 |
07c1a7d1ef69
subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23963
diff
changeset
|
961 $ hg cat -r "parents(.)" --output tmp/%h s/foobar |
07c1a7d1ef69
subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23963
diff
changeset
|
962 $ diff tmp/255ee8cf690e catparents |
07c1a7d1ef69
subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23963
diff
changeset
|
963 |
07c1a7d1ef69
subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23963
diff
changeset
|
964 $ rm tmp/10 |
07c1a7d1ef69
subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23963
diff
changeset
|
965 $ hg cat -r "parents(.)" --output tmp/%r s/foobar |
07c1a7d1ef69
subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23963
diff
changeset
|
966 $ diff tmp/10 catparents |
07c1a7d1ef69
subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23963
diff
changeset
|
967 |
07c1a7d1ef69
subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23963
diff
changeset
|
968 $ mkdir tmp/tc |
07c1a7d1ef69
subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23963
diff
changeset
|
969 $ hg cat -r "parents(.)" --output tmp/%b/foobar s/foobar |
07c1a7d1ef69
subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23963
diff
changeset
|
970 $ diff tmp/tc/foobar catparents |
07c1a7d1ef69
subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23963
diff
changeset
|
971 |
24174
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
972 cleanup |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
973 $ rm -r tmp |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
974 $ rm catparents |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
975 |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
976 add git files, using either files or patterns |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
977 $ echo "hsss! hsssssssh!" > s/snake.python |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
978 $ echo "ccc" > s/c.c |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
979 $ echo "cpp" > s/cpp.cpp |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
980 |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
981 $ hg add s/snake.python s/c.c s/cpp.cpp |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
982 $ hg st --subrepos s |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
983 M s/foobar |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
984 A s/c.c |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
985 A s/cpp.cpp |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
986 A s/snake.python |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
987 ? s/barfoo |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
988 $ hg revert s |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
989 reverting subrepo ../gitroot |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
990 |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
991 $ hg add --subrepos "glob:**.python" |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
992 adding s/snake.python (glob) |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
993 $ hg st --subrepos s |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
994 A s/snake.python |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
995 ? s/barfoo |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
996 ? s/c.c |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
997 ? s/cpp.cpp |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
998 ? s/foobar.orig |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
999 $ hg revert s |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1000 reverting subrepo ../gitroot |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1001 |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1002 $ hg add --subrepos s |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1003 adding s/barfoo (glob) |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1004 adding s/c.c (glob) |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1005 adding s/cpp.cpp (glob) |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1006 adding s/foobar.orig (glob) |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1007 adding s/snake.python (glob) |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1008 $ hg st --subrepos s |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1009 A s/barfoo |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1010 A s/c.c |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1011 A s/cpp.cpp |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1012 A s/foobar.orig |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1013 A s/snake.python |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1014 $ hg revert s |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1015 reverting subrepo ../gitroot |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1016 make sure everything is reverted correctly |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1017 $ hg st --subrepos s |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1018 ? s/barfoo |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1019 ? s/c.c |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1020 ? s/cpp.cpp |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1021 ? s/foobar.orig |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1022 ? s/snake.python |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1023 |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1024 $ hg add --subrepos --exclude "path:s/c.c" |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1025 adding s/barfoo (glob) |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1026 adding s/cpp.cpp (glob) |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1027 adding s/foobar.orig (glob) |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1028 adding s/snake.python (glob) |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1029 $ hg st --subrepos s |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1030 A s/barfoo |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1031 A s/cpp.cpp |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1032 A s/foobar.orig |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1033 A s/snake.python |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1034 ? s/c.c |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1035 $ hg revert --all -q |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1036 |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1037 .hgignore should not have influence in subrepos |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1038 $ cat > .hgignore << EOF |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1039 > syntax: glob |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1040 > *.python |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1041 > EOF |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1042 $ hg add .hgignore |
24182
00ef3edcf1d5
subrepo: don't exclude files in .hgignore when adding to git
Matt Harbison <matt_harbison@yahoo.com>
parents:
24174
diff
changeset
|
1043 $ hg add --subrepos "glob:**.python" s/barfoo |
24174
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1044 adding s/snake.python (glob) |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1045 $ hg st --subrepos s |
24182
00ef3edcf1d5
subrepo: don't exclude files in .hgignore when adding to git
Matt Harbison <matt_harbison@yahoo.com>
parents:
24174
diff
changeset
|
1046 A s/barfoo |
24174
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1047 A s/snake.python |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1048 ? s/c.c |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1049 ? s/cpp.cpp |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1050 ? s/foobar.orig |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1051 $ hg revert --all -q |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1052 |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1053 .gitignore should have influence, |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1054 except for explicitly added files (no patterns) |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1055 $ cat > s/.gitignore << EOF |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1056 > *.python |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1057 > EOF |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1058 $ hg add s/.gitignore |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1059 $ hg st --subrepos s |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1060 A s/.gitignore |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1061 ? s/barfoo |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1062 ? s/c.c |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1063 ? s/cpp.cpp |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1064 ? s/foobar.orig |
24256
e964edc3274e
subrepo: add status support for ignored and clean files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24183
diff
changeset
|
1065 $ hg st --subrepos s --all |
e964edc3274e
subrepo: add status support for ignored and clean files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24183
diff
changeset
|
1066 A s/.gitignore |
e964edc3274e
subrepo: add status support for ignored and clean files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24183
diff
changeset
|
1067 ? s/barfoo |
e964edc3274e
subrepo: add status support for ignored and clean files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24183
diff
changeset
|
1068 ? s/c.c |
e964edc3274e
subrepo: add status support for ignored and clean files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24183
diff
changeset
|
1069 ? s/cpp.cpp |
e964edc3274e
subrepo: add status support for ignored and clean files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24183
diff
changeset
|
1070 ? s/foobar.orig |
e964edc3274e
subrepo: add status support for ignored and clean files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24183
diff
changeset
|
1071 I s/snake.python |
e964edc3274e
subrepo: add status support for ignored and clean files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24183
diff
changeset
|
1072 C s/f |
e964edc3274e
subrepo: add status support for ignored and clean files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24183
diff
changeset
|
1073 C s/foobar |
e964edc3274e
subrepo: add status support for ignored and clean files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24183
diff
changeset
|
1074 C s/g |
24174
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1075 $ hg add --subrepos "glob:**.python" |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1076 $ hg st --subrepos s |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1077 A s/.gitignore |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1078 ? s/barfoo |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1079 ? s/c.c |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1080 ? s/cpp.cpp |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1081 ? s/foobar.orig |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1082 $ hg add --subrepos s/snake.python |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1083 $ hg st --subrepos s |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1084 A s/.gitignore |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1085 A s/snake.python |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1086 ? s/barfoo |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1087 ? s/c.c |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1088 ? s/cpp.cpp |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1089 ? s/foobar.orig |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1090 |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1091 correctly do a dry run |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1092 $ hg add --subrepos s --dry-run |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1093 adding s/barfoo (glob) |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1094 adding s/c.c (glob) |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1095 adding s/cpp.cpp (glob) |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1096 adding s/foobar.orig (glob) |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1097 $ hg st --subrepos s |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1098 A s/.gitignore |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1099 A s/snake.python |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1100 ? s/barfoo |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1101 ? s/c.c |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1102 ? s/cpp.cpp |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1103 ? s/foobar.orig |
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1104 |
24183
932de135041f
subrepo: warn when adding already tracked files in gitsubrepo
Matt Harbison <matt_harbison@yahoo.com>
parents:
24182
diff
changeset
|
1105 error given when adding an already tracked file |
24174
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1106 $ hg add s/.gitignore |
24183
932de135041f
subrepo: warn when adding already tracked files in gitsubrepo
Matt Harbison <matt_harbison@yahoo.com>
parents:
24182
diff
changeset
|
1107 s/.gitignore already tracked! |
932de135041f
subrepo: warn when adding already tracked files in gitsubrepo
Matt Harbison <matt_harbison@yahoo.com>
parents:
24182
diff
changeset
|
1108 [1] |
24256
e964edc3274e
subrepo: add status support for ignored and clean files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24183
diff
changeset
|
1109 $ hg add s/g |
e964edc3274e
subrepo: add status support for ignored and clean files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24183
diff
changeset
|
1110 s/g already tracked! |
e964edc3274e
subrepo: add status support for ignored and clean files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24183
diff
changeset
|
1111 [1] |
24183
932de135041f
subrepo: warn when adding already tracked files in gitsubrepo
Matt Harbison <matt_harbison@yahoo.com>
parents:
24182
diff
changeset
|
1112 |
932de135041f
subrepo: warn when adding already tracked files in gitsubrepo
Matt Harbison <matt_harbison@yahoo.com>
parents:
24182
diff
changeset
|
1113 removed files can be re-added |
24256
e964edc3274e
subrepo: add status support for ignored and clean files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24183
diff
changeset
|
1114 removing files using 'rm' or 'git rm' has the same effect, |
e964edc3274e
subrepo: add status support for ignored and clean files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24183
diff
changeset
|
1115 since we ignore the staging area |
24183
932de135041f
subrepo: warn when adding already tracked files in gitsubrepo
Matt Harbison <matt_harbison@yahoo.com>
parents:
24182
diff
changeset
|
1116 $ hg ci --subrepos -m 'snake' |
932de135041f
subrepo: warn when adding already tracked files in gitsubrepo
Matt Harbison <matt_harbison@yahoo.com>
parents:
24182
diff
changeset
|
1117 committing subrepository s |
932de135041f
subrepo: warn when adding already tracked files in gitsubrepo
Matt Harbison <matt_harbison@yahoo.com>
parents:
24182
diff
changeset
|
1118 $ cd s |
24256
e964edc3274e
subrepo: add status support for ignored and clean files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24183
diff
changeset
|
1119 $ rm snake.python |
e964edc3274e
subrepo: add status support for ignored and clean files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24183
diff
changeset
|
1120 (remove leftover .hg so Mercurial doesn't look for a root here) |
24581
85219d6ece67
tests: handle deleted .hg directory (git 2.2.0 and higher) (issue4585)
Mathias De Maré <mathias.demare@gmail.com>
parents:
24256
diff
changeset
|
1121 $ rm -rf .hg |
24256
e964edc3274e
subrepo: add status support for ignored and clean files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24183
diff
changeset
|
1122 $ hg status --subrepos --all . |
e964edc3274e
subrepo: add status support for ignored and clean files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24183
diff
changeset
|
1123 R snake.python |
e964edc3274e
subrepo: add status support for ignored and clean files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24183
diff
changeset
|
1124 ? barfoo |
e964edc3274e
subrepo: add status support for ignored and clean files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24183
diff
changeset
|
1125 ? c.c |
e964edc3274e
subrepo: add status support for ignored and clean files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24183
diff
changeset
|
1126 ? cpp.cpp |
e964edc3274e
subrepo: add status support for ignored and clean files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24183
diff
changeset
|
1127 ? foobar.orig |
e964edc3274e
subrepo: add status support for ignored and clean files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24183
diff
changeset
|
1128 C .gitignore |
e964edc3274e
subrepo: add status support for ignored and clean files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24183
diff
changeset
|
1129 C f |
e964edc3274e
subrepo: add status support for ignored and clean files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24183
diff
changeset
|
1130 C foobar |
e964edc3274e
subrepo: add status support for ignored and clean files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24183
diff
changeset
|
1131 C g |
24183
932de135041f
subrepo: warn when adding already tracked files in gitsubrepo
Matt Harbison <matt_harbison@yahoo.com>
parents:
24182
diff
changeset
|
1132 $ git rm snake.python |
932de135041f
subrepo: warn when adding already tracked files in gitsubrepo
Matt Harbison <matt_harbison@yahoo.com>
parents:
24182
diff
changeset
|
1133 rm 'snake.python' |
24256
e964edc3274e
subrepo: add status support for ignored and clean files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24183
diff
changeset
|
1134 $ hg status --subrepos --all . |
e964edc3274e
subrepo: add status support for ignored and clean files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24183
diff
changeset
|
1135 R snake.python |
e964edc3274e
subrepo: add status support for ignored and clean files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24183
diff
changeset
|
1136 ? barfoo |
e964edc3274e
subrepo: add status support for ignored and clean files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24183
diff
changeset
|
1137 ? c.c |
e964edc3274e
subrepo: add status support for ignored and clean files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24183
diff
changeset
|
1138 ? cpp.cpp |
e964edc3274e
subrepo: add status support for ignored and clean files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24183
diff
changeset
|
1139 ? foobar.orig |
e964edc3274e
subrepo: add status support for ignored and clean files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24183
diff
changeset
|
1140 C .gitignore |
e964edc3274e
subrepo: add status support for ignored and clean files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24183
diff
changeset
|
1141 C f |
e964edc3274e
subrepo: add status support for ignored and clean files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24183
diff
changeset
|
1142 C foobar |
e964edc3274e
subrepo: add status support for ignored and clean files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
24183
diff
changeset
|
1143 C g |
24183
932de135041f
subrepo: warn when adding already tracked files in gitsubrepo
Matt Harbison <matt_harbison@yahoo.com>
parents:
24182
diff
changeset
|
1144 $ touch snake.python |
932de135041f
subrepo: warn when adding already tracked files in gitsubrepo
Matt Harbison <matt_harbison@yahoo.com>
parents:
24182
diff
changeset
|
1145 $ cd .. |
932de135041f
subrepo: warn when adding already tracked files in gitsubrepo
Matt Harbison <matt_harbison@yahoo.com>
parents:
24182
diff
changeset
|
1146 $ hg add s/snake.python |
932de135041f
subrepo: warn when adding already tracked files in gitsubrepo
Matt Harbison <matt_harbison@yahoo.com>
parents:
24182
diff
changeset
|
1147 $ hg status -S |
932de135041f
subrepo: warn when adding already tracked files in gitsubrepo
Matt Harbison <matt_harbison@yahoo.com>
parents:
24182
diff
changeset
|
1148 M s/snake.python |
932de135041f
subrepo: warn when adding already tracked files in gitsubrepo
Matt Harbison <matt_harbison@yahoo.com>
parents:
24182
diff
changeset
|
1149 ? .hgignore |
932de135041f
subrepo: warn when adding already tracked files in gitsubrepo
Matt Harbison <matt_harbison@yahoo.com>
parents:
24182
diff
changeset
|
1150 ? s/barfoo |
932de135041f
subrepo: warn when adding already tracked files in gitsubrepo
Matt Harbison <matt_harbison@yahoo.com>
parents:
24182
diff
changeset
|
1151 ? s/c.c |
932de135041f
subrepo: warn when adding already tracked files in gitsubrepo
Matt Harbison <matt_harbison@yahoo.com>
parents:
24182
diff
changeset
|
1152 ? s/cpp.cpp |
932de135041f
subrepo: warn when adding already tracked files in gitsubrepo
Matt Harbison <matt_harbison@yahoo.com>
parents:
24182
diff
changeset
|
1153 ? s/foobar.orig |
24943
3e39f67ef663
subrepo: correctly handle git subdirectory status change
Mathias De Maré <mathias.demare@gmail.com>
parents:
24924
diff
changeset
|
1154 $ hg revert --all -q |
3e39f67ef663
subrepo: correctly handle git subdirectory status change
Mathias De Maré <mathias.demare@gmail.com>
parents:
24924
diff
changeset
|
1155 |
3e39f67ef663
subrepo: correctly handle git subdirectory status change
Mathias De Maré <mathias.demare@gmail.com>
parents:
24924
diff
changeset
|
1156 make sure we show changed files, rather than changed subtrees |
3e39f67ef663
subrepo: correctly handle git subdirectory status change
Mathias De Maré <mathias.demare@gmail.com>
parents:
24924
diff
changeset
|
1157 $ mkdir s/foo |
3e39f67ef663
subrepo: correctly handle git subdirectory status change
Mathias De Maré <mathias.demare@gmail.com>
parents:
24924
diff
changeset
|
1158 $ touch s/foo/bwuh |
3e39f67ef663
subrepo: correctly handle git subdirectory status change
Mathias De Maré <mathias.demare@gmail.com>
parents:
24924
diff
changeset
|
1159 $ hg add s/foo/bwuh |
3e39f67ef663
subrepo: correctly handle git subdirectory status change
Mathias De Maré <mathias.demare@gmail.com>
parents:
24924
diff
changeset
|
1160 $ hg commit -S -m "add bwuh" |
3e39f67ef663
subrepo: correctly handle git subdirectory status change
Mathias De Maré <mathias.demare@gmail.com>
parents:
24924
diff
changeset
|
1161 committing subrepository s |
3e39f67ef663
subrepo: correctly handle git subdirectory status change
Mathias De Maré <mathias.demare@gmail.com>
parents:
24924
diff
changeset
|
1162 $ hg status -S --change . |
3e39f67ef663
subrepo: correctly handle git subdirectory status change
Mathias De Maré <mathias.demare@gmail.com>
parents:
24924
diff
changeset
|
1163 M .hgsubstate |
3e39f67ef663
subrepo: correctly handle git subdirectory status change
Mathias De Maré <mathias.demare@gmail.com>
parents:
24924
diff
changeset
|
1164 A s/foo/bwuh |
3e39f67ef663
subrepo: correctly handle git subdirectory status change
Mathias De Maré <mathias.demare@gmail.com>
parents:
24924
diff
changeset
|
1165 ? s/barfoo |
3e39f67ef663
subrepo: correctly handle git subdirectory status change
Mathias De Maré <mathias.demare@gmail.com>
parents:
24924
diff
changeset
|
1166 ? s/c.c |
3e39f67ef663
subrepo: correctly handle git subdirectory status change
Mathias De Maré <mathias.demare@gmail.com>
parents:
24924
diff
changeset
|
1167 ? s/cpp.cpp |
3e39f67ef663
subrepo: correctly handle git subdirectory status change
Mathias De Maré <mathias.demare@gmail.com>
parents:
24924
diff
changeset
|
1168 ? s/foobar.orig |
3e39f67ef663
subrepo: correctly handle git subdirectory status change
Mathias De Maré <mathias.demare@gmail.com>
parents:
24924
diff
changeset
|
1169 ? s/snake.python.orig |
24174
bd9f64ec891d
subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23991
diff
changeset
|
1170 |
32902
642feee29d70
tests: protect tests involving git ext::sh with git-ext-sh
Sean Farley <sean@farley.io>
parents:
32413
diff
changeset
|
1171 #if git19 |
642feee29d70
tests: protect tests involving git ext::sh with git-ext-sh
Sean Farley <sean@farley.io>
parents:
32413
diff
changeset
|
1172 |
28658
34d43cb85de8
subrepo: set GIT_ALLOW_PROTOCOL to limit git clone protocols (SEC)
Mateusz Kwapich <mitrandir@fb.com>
parents:
26969
diff
changeset
|
1173 test for Git CVE-2016-3068 |
34d43cb85de8
subrepo: set GIT_ALLOW_PROTOCOL to limit git clone protocols (SEC)
Mateusz Kwapich <mitrandir@fb.com>
parents:
26969
diff
changeset
|
1174 $ hg init malicious-subrepository |
34d43cb85de8
subrepo: set GIT_ALLOW_PROTOCOL to limit git clone protocols (SEC)
Mateusz Kwapich <mitrandir@fb.com>
parents:
26969
diff
changeset
|
1175 $ cd malicious-subrepository |
29295
9b4f0ad02f51
tests-subrepo-git: use "f" to dump pwned.txt, for portability
Danek Duvall <danek.duvall@oracle.com>
parents:
29257
diff
changeset
|
1176 $ echo "s = [git]ext::sh -c echo% pwned:% \$PWNED_MSG% >pwned.txt" > .hgsub |
28658
34d43cb85de8
subrepo: set GIT_ALLOW_PROTOCOL to limit git clone protocols (SEC)
Mateusz Kwapich <mitrandir@fb.com>
parents:
26969
diff
changeset
|
1177 $ git init s |
34d43cb85de8
subrepo: set GIT_ALLOW_PROTOCOL to limit git clone protocols (SEC)
Mateusz Kwapich <mitrandir@fb.com>
parents:
26969
diff
changeset
|
1178 Initialized empty Git repository in $TESTTMP/tc/malicious-subrepository/s/.git/ |
34d43cb85de8
subrepo: set GIT_ALLOW_PROTOCOL to limit git clone protocols (SEC)
Mateusz Kwapich <mitrandir@fb.com>
parents:
26969
diff
changeset
|
1179 $ cd s |
34d43cb85de8
subrepo: set GIT_ALLOW_PROTOCOL to limit git clone protocols (SEC)
Mateusz Kwapich <mitrandir@fb.com>
parents:
26969
diff
changeset
|
1180 $ git commit --allow-empty -m 'empty' |
34d43cb85de8
subrepo: set GIT_ALLOW_PROTOCOL to limit git clone protocols (SEC)
Mateusz Kwapich <mitrandir@fb.com>
parents:
26969
diff
changeset
|
1181 [master (root-commit) 153f934] empty |
23523
01a8dfc79cdc
subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents:
23411
diff
changeset
|
1182 $ cd .. |
28658
34d43cb85de8
subrepo: set GIT_ALLOW_PROTOCOL to limit git clone protocols (SEC)
Mateusz Kwapich <mitrandir@fb.com>
parents:
26969
diff
changeset
|
1183 $ hg add .hgsub |
34d43cb85de8
subrepo: set GIT_ALLOW_PROTOCOL to limit git clone protocols (SEC)
Mateusz Kwapich <mitrandir@fb.com>
parents:
26969
diff
changeset
|
1184 $ hg commit -m "add subrepo" |
34d43cb85de8
subrepo: set GIT_ALLOW_PROTOCOL to limit git clone protocols (SEC)
Mateusz Kwapich <mitrandir@fb.com>
parents:
26969
diff
changeset
|
1185 $ cd .. |
29256
1f8b861ba15c
tests-subrepo-git: make the "pwned" message output in a stable order
Danek Duvall <danek.duvall@oracle.com>
parents:
28939
diff
changeset
|
1186 $ rm -f pwned.txt |
29135
3879d02cd1cc
subrepo: use unset instead of env -u to fix test on BSDs (issue5229)
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents:
28939
diff
changeset
|
1187 $ unset GIT_ALLOW_PROTOCOL |
29328 | 1188 $ PWNED_MSG="your git is too old or mercurial has regressed" hg clone \ |
29257
a9764ab80e11
tests-subrepo-git: emit a different "pwned" message based on the test
Danek Duvall <danek.duvall@oracle.com>
parents:
29256
diff
changeset
|
1189 > malicious-subrepository malicious-subrepository-protected |
28939
ce01b4810aef
test-subrepo-git: add globs for Windows
Matt Harbison <matt_harbison@yahoo.com>
parents:
28670
diff
changeset
|
1190 Cloning into '$TESTTMP/tc/malicious-subrepository-protected/s'... (glob) |
28658
34d43cb85de8
subrepo: set GIT_ALLOW_PROTOCOL to limit git clone protocols (SEC)
Mateusz Kwapich <mitrandir@fb.com>
parents:
26969
diff
changeset
|
1191 fatal: transport 'ext' not allowed |
34d43cb85de8
subrepo: set GIT_ALLOW_PROTOCOL to limit git clone protocols (SEC)
Mateusz Kwapich <mitrandir@fb.com>
parents:
26969
diff
changeset
|
1192 updating to branch default |
29295
9b4f0ad02f51
tests-subrepo-git: use "f" to dump pwned.txt, for portability
Danek Duvall <danek.duvall@oracle.com>
parents:
29257
diff
changeset
|
1193 cloning subrepo s from ext::sh -c echo% pwned:% $PWNED_MSG% >pwned.txt |
33365
6d88468d435b
subrepo: make the output references to subrepositories consistent
Matt Harbison <matt_harbison@yahoo.com>
parents:
32902
diff
changeset
|
1194 abort: git clone error 128 in s (in subrepository "s") |
28658
34d43cb85de8
subrepo: set GIT_ALLOW_PROTOCOL to limit git clone protocols (SEC)
Mateusz Kwapich <mitrandir@fb.com>
parents:
26969
diff
changeset
|
1195 [255] |
29295
9b4f0ad02f51
tests-subrepo-git: use "f" to dump pwned.txt, for portability
Danek Duvall <danek.duvall@oracle.com>
parents:
29257
diff
changeset
|
1196 $ f -Dq pwned.txt |
9b4f0ad02f51
tests-subrepo-git: use "f" to dump pwned.txt, for portability
Danek Duvall <danek.duvall@oracle.com>
parents:
29257
diff
changeset
|
1197 pwned.txt: file not found |
28658
34d43cb85de8
subrepo: set GIT_ALLOW_PROTOCOL to limit git clone protocols (SEC)
Mateusz Kwapich <mitrandir@fb.com>
parents:
26969
diff
changeset
|
1198 |
34d43cb85de8
subrepo: set GIT_ALLOW_PROTOCOL to limit git clone protocols (SEC)
Mateusz Kwapich <mitrandir@fb.com>
parents:
26969
diff
changeset
|
1199 whitelisting of ext should be respected (that's the git submodule behaviour) |
29256
1f8b861ba15c
tests-subrepo-git: make the "pwned" message output in a stable order
Danek Duvall <danek.duvall@oracle.com>
parents:
28939
diff
changeset
|
1200 $ rm -f pwned.txt |
29257
a9764ab80e11
tests-subrepo-git: emit a different "pwned" message based on the test
Danek Duvall <danek.duvall@oracle.com>
parents:
29256
diff
changeset
|
1201 $ env GIT_ALLOW_PROTOCOL=ext PWNED_MSG="you asked for it" hg clone \ |
a9764ab80e11
tests-subrepo-git: emit a different "pwned" message based on the test
Danek Duvall <danek.duvall@oracle.com>
parents:
29256
diff
changeset
|
1202 > malicious-subrepository malicious-subrepository-clone-allowed |
28939
ce01b4810aef
test-subrepo-git: add globs for Windows
Matt Harbison <matt_harbison@yahoo.com>
parents:
28670
diff
changeset
|
1203 Cloning into '$TESTTMP/tc/malicious-subrepository-clone-allowed/s'... (glob) |
28658
34d43cb85de8
subrepo: set GIT_ALLOW_PROTOCOL to limit git clone protocols (SEC)
Mateusz Kwapich <mitrandir@fb.com>
parents:
26969
diff
changeset
|
1204 fatal: Could not read from remote repository. |
34d43cb85de8
subrepo: set GIT_ALLOW_PROTOCOL to limit git clone protocols (SEC)
Mateusz Kwapich <mitrandir@fb.com>
parents:
26969
diff
changeset
|
1205 |
34d43cb85de8
subrepo: set GIT_ALLOW_PROTOCOL to limit git clone protocols (SEC)
Mateusz Kwapich <mitrandir@fb.com>
parents:
26969
diff
changeset
|
1206 Please make sure you have the correct access rights |
34d43cb85de8
subrepo: set GIT_ALLOW_PROTOCOL to limit git clone protocols (SEC)
Mateusz Kwapich <mitrandir@fb.com>
parents:
26969
diff
changeset
|
1207 and the repository exists. |
34d43cb85de8
subrepo: set GIT_ALLOW_PROTOCOL to limit git clone protocols (SEC)
Mateusz Kwapich <mitrandir@fb.com>
parents:
26969
diff
changeset
|
1208 updating to branch default |
29295
9b4f0ad02f51
tests-subrepo-git: use "f" to dump pwned.txt, for portability
Danek Duvall <danek.duvall@oracle.com>
parents:
29257
diff
changeset
|
1209 cloning subrepo s from ext::sh -c echo% pwned:% $PWNED_MSG% >pwned.txt |
33365
6d88468d435b
subrepo: make the output references to subrepositories consistent
Matt Harbison <matt_harbison@yahoo.com>
parents:
32902
diff
changeset
|
1210 abort: git clone error 128 in s (in subrepository "s") |
28658
34d43cb85de8
subrepo: set GIT_ALLOW_PROTOCOL to limit git clone protocols (SEC)
Mateusz Kwapich <mitrandir@fb.com>
parents:
26969
diff
changeset
|
1211 [255] |
29295
9b4f0ad02f51
tests-subrepo-git: use "f" to dump pwned.txt, for portability
Danek Duvall <danek.duvall@oracle.com>
parents:
29257
diff
changeset
|
1212 $ f -Dq pwned.txt |
9b4f0ad02f51
tests-subrepo-git: use "f" to dump pwned.txt, for portability
Danek Duvall <danek.duvall@oracle.com>
parents:
29257
diff
changeset
|
1213 pwned: you asked for it |
32902
642feee29d70
tests: protect tests involving git ext::sh with git-ext-sh
Sean Farley <sean@farley.io>
parents:
32413
diff
changeset
|
1214 |
642feee29d70
tests: protect tests involving git ext::sh with git-ext-sh
Sean Farley <sean@farley.io>
parents:
32413
diff
changeset
|
1215 #endif |
33658
db83a1df03fe
subrepo: add tests for git rogue ssh urls (SEC)
Sean Farley <sean@farley.io>
parents:
33365
diff
changeset
|
1216 |
db83a1df03fe
subrepo: add tests for git rogue ssh urls (SEC)
Sean Farley <sean@farley.io>
parents:
33365
diff
changeset
|
1217 test for ssh exploit with git subrepos 2017-07-25 |
db83a1df03fe
subrepo: add tests for git rogue ssh urls (SEC)
Sean Farley <sean@farley.io>
parents:
33365
diff
changeset
|
1218 |
db83a1df03fe
subrepo: add tests for git rogue ssh urls (SEC)
Sean Farley <sean@farley.io>
parents:
33365
diff
changeset
|
1219 $ hg init malicious-proxycommand |
db83a1df03fe
subrepo: add tests for git rogue ssh urls (SEC)
Sean Farley <sean@farley.io>
parents:
33365
diff
changeset
|
1220 $ cd malicious-proxycommand |
db83a1df03fe
subrepo: add tests for git rogue ssh urls (SEC)
Sean Farley <sean@farley.io>
parents:
33365
diff
changeset
|
1221 $ echo 's = [git]ssh://-oProxyCommand=rm${IFS}non-existent/path' > .hgsub |
db83a1df03fe
subrepo: add tests for git rogue ssh urls (SEC)
Sean Farley <sean@farley.io>
parents:
33365
diff
changeset
|
1222 $ git init s |
db83a1df03fe
subrepo: add tests for git rogue ssh urls (SEC)
Sean Farley <sean@farley.io>
parents:
33365
diff
changeset
|
1223 Initialized empty Git repository in $TESTTMP/tc/malicious-proxycommand/s/.git/ |
db83a1df03fe
subrepo: add tests for git rogue ssh urls (SEC)
Sean Farley <sean@farley.io>
parents:
33365
diff
changeset
|
1224 $ cd s |
db83a1df03fe
subrepo: add tests for git rogue ssh urls (SEC)
Sean Farley <sean@farley.io>
parents:
33365
diff
changeset
|
1225 $ git commit --allow-empty -m 'empty' |
db83a1df03fe
subrepo: add tests for git rogue ssh urls (SEC)
Sean Farley <sean@farley.io>
parents:
33365
diff
changeset
|
1226 [master (root-commit) 153f934] empty |
db83a1df03fe
subrepo: add tests for git rogue ssh urls (SEC)
Sean Farley <sean@farley.io>
parents:
33365
diff
changeset
|
1227 $ cd .. |
db83a1df03fe
subrepo: add tests for git rogue ssh urls (SEC)
Sean Farley <sean@farley.io>
parents:
33365
diff
changeset
|
1228 $ hg add .hgsub |
db83a1df03fe
subrepo: add tests for git rogue ssh urls (SEC)
Sean Farley <sean@farley.io>
parents:
33365
diff
changeset
|
1229 $ hg ci -m 'add subrepo' |
db83a1df03fe
subrepo: add tests for git rogue ssh urls (SEC)
Sean Farley <sean@farley.io>
parents:
33365
diff
changeset
|
1230 $ cd .. |
db83a1df03fe
subrepo: add tests for git rogue ssh urls (SEC)
Sean Farley <sean@farley.io>
parents:
33365
diff
changeset
|
1231 $ hg clone malicious-proxycommand malicious-proxycommand-clone |
db83a1df03fe
subrepo: add tests for git rogue ssh urls (SEC)
Sean Farley <sean@farley.io>
parents:
33365
diff
changeset
|
1232 updating to branch default |
db83a1df03fe
subrepo: add tests for git rogue ssh urls (SEC)
Sean Farley <sean@farley.io>
parents:
33365
diff
changeset
|
1233 abort: potentially unsafe url: 'ssh://-oProxyCommand=rm${IFS}non-existent/path' (in subrepository "s") |
db83a1df03fe
subrepo: add tests for git rogue ssh urls (SEC)
Sean Farley <sean@farley.io>
parents:
33365
diff
changeset
|
1234 [255] |
db83a1df03fe
subrepo: add tests for git rogue ssh urls (SEC)
Sean Farley <sean@farley.io>
parents:
33365
diff
changeset
|
1235 |
db83a1df03fe
subrepo: add tests for git rogue ssh urls (SEC)
Sean Farley <sean@farley.io>
parents:
33365
diff
changeset
|
1236 also check that a percent encoded '-' (%2D) doesn't work |
db83a1df03fe
subrepo: add tests for git rogue ssh urls (SEC)
Sean Farley <sean@farley.io>
parents:
33365
diff
changeset
|
1237 |
db83a1df03fe
subrepo: add tests for git rogue ssh urls (SEC)
Sean Farley <sean@farley.io>
parents:
33365
diff
changeset
|
1238 $ cd malicious-proxycommand |
db83a1df03fe
subrepo: add tests for git rogue ssh urls (SEC)
Sean Farley <sean@farley.io>
parents:
33365
diff
changeset
|
1239 $ echo 's = [git]ssh://%2DoProxyCommand=rm${IFS}non-existent/path' > .hgsub |
db83a1df03fe
subrepo: add tests for git rogue ssh urls (SEC)
Sean Farley <sean@farley.io>
parents:
33365
diff
changeset
|
1240 $ hg ci -m 'change url to percent encoded' |
db83a1df03fe
subrepo: add tests for git rogue ssh urls (SEC)
Sean Farley <sean@farley.io>
parents:
33365
diff
changeset
|
1241 $ cd .. |
db83a1df03fe
subrepo: add tests for git rogue ssh urls (SEC)
Sean Farley <sean@farley.io>
parents:
33365
diff
changeset
|
1242 $ rm -r malicious-proxycommand-clone |
db83a1df03fe
subrepo: add tests for git rogue ssh urls (SEC)
Sean Farley <sean@farley.io>
parents:
33365
diff
changeset
|
1243 $ hg clone malicious-proxycommand malicious-proxycommand-clone |
db83a1df03fe
subrepo: add tests for git rogue ssh urls (SEC)
Sean Farley <sean@farley.io>
parents:
33365
diff
changeset
|
1244 updating to branch default |
db83a1df03fe
subrepo: add tests for git rogue ssh urls (SEC)
Sean Farley <sean@farley.io>
parents:
33365
diff
changeset
|
1245 abort: potentially unsafe url: 'ssh://-oProxyCommand=rm${IFS}non-existent/path' (in subrepository "s") |
db83a1df03fe
subrepo: add tests for git rogue ssh urls (SEC)
Sean Farley <sean@farley.io>
parents:
33365
diff
changeset
|
1246 [255] |