tests/test-subrepo-git.t
author Matt Harbison <matt_harbison@yahoo.com>
Thu, 26 Feb 2015 15:53:54 -0500
changeset 24182 00ef3edcf1d5
parent 24174 bd9f64ec891d
child 24183 932de135041f
permissions -rw-r--r--
subrepo: don't exclude files in .hgignore when adding to git The previous test gave a false success because only an hg-ignored pattern was specified. Therefore match.files() was empty, and it fell back to the files unknown to git. The simplest fix is to always consider what is unknown to git, as well as anything specified explicitly. Files that are ignored by git can only be introduced by an explicit mention in match.files().
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
17022
8a38839ae1dc test-subrepo-git.t: adapt for Windows
Eduard-Cristian Stefan <alexandrul.ct@gmail.com>
parents: 16913
diff changeset
     5
  $ echo "[core]" >> $HOME/.gitconfig
8a38839ae1dc test-subrepo-git.t: adapt for Windows
Eduard-Cristian Stefan <alexandrul.ct@gmail.com>
parents: 16913
diff changeset
     6
  $ echo "autocrlf = false" >> $HOME/.gitconfig
12992
2b73a3279a9f subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff changeset
     7
  $ GIT_AUTHOR_NAME='test'; export GIT_AUTHOR_NAME
2b73a3279a9f subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff changeset
     8
  $ 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
     9
  $ 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
    10
  $ 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
    11
  $ 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
    12
  $ 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
    13
  $ 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
    14
2b73a3279a9f subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff changeset
    15
root hg repo
2b73a3279a9f subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff changeset
    16
2b73a3279a9f subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff changeset
    17
  $ hg init t
2b73a3279a9f subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff changeset
    18
  $ cd t
2b73a3279a9f subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff changeset
    19
  $ echo a > a
2b73a3279a9f subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff changeset
    20
  $ hg add a
2b73a3279a9f subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff changeset
    21
  $ hg commit -m a
2b73a3279a9f subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff changeset
    22
  $ cd ..
2b73a3279a9f subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff changeset
    23
2b73a3279a9f subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff changeset
    24
new external git repo
2b73a3279a9f subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff changeset
    25
2b73a3279a9f subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff changeset
    26
  $ mkdir gitroot
2b73a3279a9f subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff changeset
    27
  $ cd gitroot
2b73a3279a9f subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff changeset
    28
  $ git init -q
2b73a3279a9f subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff changeset
    29
  $ echo g > g
2b73a3279a9f subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff changeset
    30
  $ git add g
2b73a3279a9f subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff changeset
    31
  $ git commit -q -m g
2b73a3279a9f subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff changeset
    32
2b73a3279a9f subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff changeset
    33
add subrepo clone
2b73a3279a9f subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff changeset
    34
2b73a3279a9f subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff changeset
    35
  $ cd ../t
2b73a3279a9f subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff changeset
    36
  $ echo 's = [git]../gitroot' > .hgsub
2b73a3279a9f subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff changeset
    37
  $ git clone -q ../gitroot s
2b73a3279a9f subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff changeset
    38
  $ hg add .hgsub
2b73a3279a9f subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff changeset
    39
  $ hg commit -m 'new git subrepo'
2b73a3279a9f subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff changeset
    40
  $ hg debugsub
2b73a3279a9f subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff changeset
    41
  path s
2b73a3279a9f subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff changeset
    42
   source   ../gitroot
2b73a3279a9f subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff changeset
    43
   revision da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7
2b73a3279a9f subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff changeset
    44
12995
d90fc91c8377 subrepo: update and merge works with any git branch
Eric Eisner <ede@mit.edu>
parents: 12994
diff changeset
    45
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
    46
2b73a3279a9f subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff changeset
    47
  $ cd ../gitroot
13091
8cecea387574 test-subrepo-git.t: silence git output
Eric Eisner <ede@mit.edu>
parents: 13087
diff changeset
    48
  $ git checkout -q -b testing
12992
2b73a3279a9f subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff changeset
    49
  $ echo gg >> g
2b73a3279a9f subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff changeset
    50
  $ git commit -q -a -m gg
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 ../t/s
13091
8cecea387574 test-subrepo-git.t: silence git output
Eric Eisner <ede@mit.edu>
parents: 13087
diff changeset
    53
  $ 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
    54
  $ 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
    55
2b73a3279a9f subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff changeset
    56
  $ cd ..
13182
2537bd17421d subrepo: basic support for status of git subrepos
Eric Eisner <ede@mit.edu>
parents: 13181
diff changeset
    57
  $ hg status --subrepos
2537bd17421d subrepo: basic support for status of git subrepos
Eric Eisner <ede@mit.edu>
parents: 13181
diff changeset
    58
  M s/g
12992
2b73a3279a9f subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff changeset
    59
  $ hg commit -m 'update git subrepo'
2b73a3279a9f subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff changeset
    60
  $ hg debugsub
2b73a3279a9f subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff changeset
    61
  path s
2b73a3279a9f subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff changeset
    62
   source   ../gitroot
2b73a3279a9f subrepo: support for adding a git subrepo
Eric Eisner <ede@mit.edu>
parents:
diff changeset
    63
   revision 126f2a14290cd5ce061fdedc430170e8d39e1c5a
12993
a91334380699 subrepo: cloning and updating of git subrepos
Eric Eisner <ede@mit.edu>
parents: 12992
diff changeset
    64
13092
83986af605e5 test-subrepo-git.t: make gitroot pushable earlier
Eric Eisner <ede@mit.edu>
parents: 13091
diff changeset
    65
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
    66
83986af605e5 test-subrepo-git.t: make gitroot pushable earlier
Eric Eisner <ede@mit.edu>
parents: 13091
diff changeset
    67
  $ cd ..
83986af605e5 test-subrepo-git.t: make gitroot pushable earlier
Eric Eisner <ede@mit.edu>
parents: 13091
diff changeset
    68
  $ git clone gitroot gitrootbare --bare -q
83986af605e5 test-subrepo-git.t: make gitroot pushable earlier
Eric Eisner <ede@mit.edu>
parents: 13091
diff changeset
    69
  $ rm -rf gitroot
83986af605e5 test-subrepo-git.t: make gitroot pushable earlier
Eric Eisner <ede@mit.edu>
parents: 13091
diff changeset
    70
  $ mv gitrootbare gitroot
83986af605e5 test-subrepo-git.t: make gitroot pushable earlier
Eric Eisner <ede@mit.edu>
parents: 13091
diff changeset
    71
12993
a91334380699 subrepo: cloning and updating of git subrepos
Eric Eisner <ede@mit.edu>
parents: 12992
diff changeset
    72
clone root
a91334380699 subrepo: cloning and updating of git subrepos
Eric Eisner <ede@mit.edu>
parents: 12992
diff changeset
    73
13092
83986af605e5 test-subrepo-git.t: make gitroot pushable earlier
Eric Eisner <ede@mit.edu>
parents: 13091
diff changeset
    74
  $ cd t
20105
c5a0f899e47b tests: deal with new gits sending status messages to stderr
Mads Kiilerich <madski@unity3d.com>
parents: 19811
diff changeset
    75
  $ hg clone . ../tc 2> /dev/null
12993
a91334380699 subrepo: cloning and updating of git subrepos
Eric Eisner <ede@mit.edu>
parents: 12992
diff changeset
    76
  updating to branch default
13525
c12088259f64 subrepo: show the source that git clones
Eric Eisner <ede@mit.edu>
parents: 13460
diff changeset
    77
  cloning subrepo s from $TESTTMP/gitroot
12993
a91334380699 subrepo: cloning and updating of git subrepos
Eric Eisner <ede@mit.edu>
parents: 12992
diff changeset
    78
  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
    79
  $ cd ../tc
a91334380699 subrepo: cloning and updating of git subrepos
Eric Eisner <ede@mit.edu>
parents: 12992
diff changeset
    80
  $ hg debugsub
a91334380699 subrepo: cloning and updating of git subrepos
Eric Eisner <ede@mit.edu>
parents: 12992
diff changeset
    81
  path s
a91334380699 subrepo: cloning and updating of git subrepos
Eric Eisner <ede@mit.edu>
parents: 12992
diff changeset
    82
   source   ../gitroot
a91334380699 subrepo: cloning and updating of git subrepos
Eric Eisner <ede@mit.edu>
parents: 12992
diff changeset
    83
   revision 126f2a14290cd5ce061fdedc430170e8d39e1c5a
a91334380699 subrepo: cloning and updating of git subrepos
Eric Eisner <ede@mit.edu>
parents: 12992
diff changeset
    84
a91334380699 subrepo: cloning and updating of git subrepos
Eric Eisner <ede@mit.edu>
parents: 12992
diff changeset
    85
update to previous substate
a91334380699 subrepo: cloning and updating of git subrepos
Eric Eisner <ede@mit.edu>
parents: 12992
diff changeset
    86
13111
560b8001f765 subrepo: silence git output when ui.quiet is set
Eric Eisner <ede@mit.edu>
parents: 13092
diff changeset
    87
  $ hg update 1 -q
12993
a91334380699 subrepo: cloning and updating of git subrepos
Eric Eisner <ede@mit.edu>
parents: 12992
diff changeset
    88
  $ cat s/g
a91334380699 subrepo: cloning and updating of git subrepos
Eric Eisner <ede@mit.edu>
parents: 12992
diff changeset
    89
  g
a91334380699 subrepo: cloning and updating of git subrepos
Eric Eisner <ede@mit.edu>
parents: 12992
diff changeset
    90
  $ hg debugsub
a91334380699 subrepo: cloning and updating of git subrepos
Eric Eisner <ede@mit.edu>
parents: 12992
diff changeset
    91
  path s
a91334380699 subrepo: cloning and updating of git subrepos
Eric Eisner <ede@mit.edu>
parents: 12992
diff changeset
    92
   source   ../gitroot
a91334380699 subrepo: cloning and updating of git subrepos
Eric Eisner <ede@mit.edu>
parents: 12992
diff changeset
    93
   revision da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7
12994
845c602b8635 subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents: 12993
diff changeset
    94
845c602b8635 subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents: 12993
diff changeset
    95
clone root, make local change
845c602b8635 subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents: 12993
diff changeset
    96
13092
83986af605e5 test-subrepo-git.t: make gitroot pushable earlier
Eric Eisner <ede@mit.edu>
parents: 13091
diff changeset
    97
  $ cd ../t
20105
c5a0f899e47b tests: deal with new gits sending status messages to stderr
Mads Kiilerich <madski@unity3d.com>
parents: 19811
diff changeset
    98
  $ 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
    99
  updating to branch default
13525
c12088259f64 subrepo: show the source that git clones
Eric Eisner <ede@mit.edu>
parents: 13460
diff changeset
   100
  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
   101
  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
   102
845c602b8635 subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents: 12993
diff changeset
   103
  $ cd ../ta
845c602b8635 subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents: 12993
diff changeset
   104
  $ echo ggg >> s/g
13182
2537bd17421d subrepo: basic support for status of git subrepos
Eric Eisner <ede@mit.edu>
parents: 13181
diff changeset
   105
  $ hg status --subrepos
2537bd17421d subrepo: basic support for status of git subrepos
Eric Eisner <ede@mit.edu>
parents: 13181
diff changeset
   106
  M s/g
23523
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   107
  $ hg diff --subrepos
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   108
  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
   109
  index 089258f..85341ee 100644
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   110
  --- a/s/g
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   111
  +++ b/s/g
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   112
  @@ -1,2 +1,3 @@
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   113
   g
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   114
   gg
23938
de519517f597 subrepo: correctly add newline for git subrepo diffs
Mathias De Maré <mathias.demare@gmail.com>
parents: 23937
diff changeset
   115
  +ggg
15321
e174353e8cda subrepos: abort commit by default if a subrepo is dirty (BC)
Martin Geisler <mg@lazybytes.net>
parents: 14481
diff changeset
   116
  $ hg commit --subrepos -m ggg
13181
413bef846806 subrepo: fix subrelpath for git subrepos
Eric Eisner <ede@mit.edu>
parents: 13111
diff changeset
   117
  committing subrepository s
12994
845c602b8635 subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents: 12993
diff changeset
   118
  $ hg debugsub
845c602b8635 subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents: 12993
diff changeset
   119
  path s
845c602b8635 subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents: 12993
diff changeset
   120
   source   ../gitroot
845c602b8635 subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents: 12993
diff changeset
   121
   revision 79695940086840c99328513acbe35f90fcd55e57
845c602b8635 subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents: 12993
diff changeset
   122
845c602b8635 subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents: 12993
diff changeset
   123
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
   124
845c602b8635 subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents: 12993
diff changeset
   125
  $ cd ../t
20105
c5a0f899e47b tests: deal with new gits sending status messages to stderr
Mads Kiilerich <madski@unity3d.com>
parents: 19811
diff changeset
   126
  $ 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
   127
  updating to branch default
13525
c12088259f64 subrepo: show the source that git clones
Eric Eisner <ede@mit.edu>
parents: 13460
diff changeset
   128
  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
   129
  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
   130
845c602b8635 subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents: 12993
diff changeset
   131
  $ 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
   132
  $ hg status --subrepos
12994
845c602b8635 subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents: 12993
diff changeset
   133
  $ 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
   134
  $ 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
   135
  ? 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
   136
  $ hg add .
24174
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   137
  adding f
12994
845c602b8635 subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents: 12993
diff changeset
   138
  $ git add f
845c602b8635 subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents: 12993
diff changeset
   139
  $ cd ..
845c602b8635 subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents: 12993
diff changeset
   140
13182
2537bd17421d subrepo: basic support for status of git subrepos
Eric Eisner <ede@mit.edu>
parents: 13181
diff changeset
   141
  $ hg status --subrepos
2537bd17421d subrepo: basic support for status of git subrepos
Eric Eisner <ede@mit.edu>
parents: 13181
diff changeset
   142
  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
   143
  $ hg commit --subrepos -m f
13181
413bef846806 subrepo: fix subrelpath for git subrepos
Eric Eisner <ede@mit.edu>
parents: 13111
diff changeset
   144
  committing subrepository s
12994
845c602b8635 subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents: 12993
diff changeset
   145
  $ hg debugsub
845c602b8635 subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents: 12993
diff changeset
   146
  path s
845c602b8635 subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents: 12993
diff changeset
   147
   source   ../gitroot
845c602b8635 subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents: 12993
diff changeset
   148
   revision aa84837ccfbdfedcdcdeeedc309d73e6eb069edc
845c602b8635 subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents: 12993
diff changeset
   149
845c602b8635 subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents: 12993
diff changeset
   150
user b push changes
845c602b8635 subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents: 12993
diff changeset
   151
13091
8cecea387574 test-subrepo-git.t: silence git output
Eric Eisner <ede@mit.edu>
parents: 13087
diff changeset
   152
  $ 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
   153
  pushing to $TESTTMP/t (glob)
13029
f930032aa6d5 subrepo: lazier git push logic
Eric Eisner <ede@mit.edu>
parents: 13027
diff changeset
   154
  pushing branch testing of subrepo s
12994
845c602b8635 subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents: 12993
diff changeset
   155
  searching for changes
845c602b8635 subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents: 12993
diff changeset
   156
  adding changesets
845c602b8635 subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents: 12993
diff changeset
   157
  adding manifests
845c602b8635 subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents: 12993
diff changeset
   158
  adding file changes
845c602b8635 subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents: 12993
diff changeset
   159
  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
   160
845c602b8635 subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents: 12993
diff changeset
   161
user a pulls, merges, commits
845c602b8635 subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents: 12993
diff changeset
   162
845c602b8635 subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents: 12993
diff changeset
   163
  $ cd ../ta
845c602b8635 subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents: 12993
diff changeset
   164
  $ hg pull
17022
8a38839ae1dc test-subrepo-git.t: adapt for Windows
Eduard-Cristian Stefan <alexandrul.ct@gmail.com>
parents: 16913
diff changeset
   165
  pulling from $TESTTMP/t (glob)
12994
845c602b8635 subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents: 12993
diff changeset
   166
  searching for changes
845c602b8635 subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents: 12993
diff changeset
   167
  adding changesets
845c602b8635 subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents: 12993
diff changeset
   168
  adding manifests
845c602b8635 subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents: 12993
diff changeset
   169
  adding file changes
845c602b8635 subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents: 12993
diff changeset
   170
  added 1 changesets with 1 changes to 1 files (+1 heads)
845c602b8635 subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents: 12993
diff changeset
   171
  (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
   172
  $ 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
   173
   subrepository s diverged (local revision: 7969594, remote revision: aa84837)
19811
5e10d41e7b9c merge: let the user choose to merge, keep local or keep remote subrepo revisions
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 19049
diff changeset
   174
  (M)erge, keep (l)ocal or keep (r)emote? m
13569
3ab3b892d223 subrepo: show the source that git pulls
Eric Eisner <ede@mit.edu>
parents: 13560
diff changeset
   175
  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
   176
  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
   177
  (branch merge, don't forget to commit)
845c602b8635 subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents: 12993
diff changeset
   178
  $ cat s/f
845c602b8635 subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents: 12993
diff changeset
   179
  f
845c602b8635 subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents: 12993
diff changeset
   180
  $ cat s/g
845c602b8635 subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents: 12993
diff changeset
   181
  g
845c602b8635 subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents: 12993
diff changeset
   182
  gg
845c602b8635 subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents: 12993
diff changeset
   183
  ggg
15321
e174353e8cda subrepos: abort commit by default if a subrepo is dirty (BC)
Martin Geisler <mg@lazybytes.net>
parents: 14481
diff changeset
   184
  $ hg commit --subrepos -m 'merge'
13181
413bef846806 subrepo: fix subrelpath for git subrepos
Eric Eisner <ede@mit.edu>
parents: 13111
diff changeset
   185
  committing subrepository s
13182
2537bd17421d subrepo: basic support for status of git subrepos
Eric Eisner <ede@mit.edu>
parents: 13181
diff changeset
   186
  $ hg status --subrepos --rev 1:5
2537bd17421d subrepo: basic support for status of git subrepos
Eric Eisner <ede@mit.edu>
parents: 13181
diff changeset
   187
  M .hgsubstate
2537bd17421d subrepo: basic support for status of git subrepos
Eric Eisner <ede@mit.edu>
parents: 13181
diff changeset
   188
  M s/g
2537bd17421d subrepo: basic support for status of git subrepos
Eric Eisner <ede@mit.edu>
parents: 13181
diff changeset
   189
  A s/f
12994
845c602b8635 subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents: 12993
diff changeset
   190
  $ hg debugsub
845c602b8635 subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents: 12993
diff changeset
   191
  path s
845c602b8635 subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents: 12993
diff changeset
   192
   source   ../gitroot
845c602b8635 subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents: 12993
diff changeset
   193
   revision f47b465e1bce645dbf37232a00574aa1546ca8d3
13091
8cecea387574 test-subrepo-git.t: silence git output
Eric Eisner <ede@mit.edu>
parents: 13087
diff changeset
   194
  $ 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
   195
  pushing to $TESTTMP/t (glob)
13029
f930032aa6d5 subrepo: lazier git push logic
Eric Eisner <ede@mit.edu>
parents: 13027
diff changeset
   196
  pushing branch testing of subrepo s
12994
845c602b8635 subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents: 12993
diff changeset
   197
  searching for changes
845c602b8635 subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents: 12993
diff changeset
   198
  adding changesets
845c602b8635 subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents: 12993
diff changeset
   199
  adding manifests
845c602b8635 subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents: 12993
diff changeset
   200
  adding file changes
845c602b8635 subrepo: allow git subrepos to push and merge
Eric Eisner <ede@mit.edu>
parents: 12993
diff changeset
   201
  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
   202
13029
f930032aa6d5 subrepo: lazier git push logic
Eric Eisner <ede@mit.edu>
parents: 13027
diff changeset
   203
make upstream git changes
f930032aa6d5 subrepo: lazier git push logic
Eric Eisner <ede@mit.edu>
parents: 13027
diff changeset
   204
f930032aa6d5 subrepo: lazier git push logic
Eric Eisner <ede@mit.edu>
parents: 13027
diff changeset
   205
  $ cd ..
f930032aa6d5 subrepo: lazier git push logic
Eric Eisner <ede@mit.edu>
parents: 13027
diff changeset
   206
  $ git clone -q gitroot gitclone
f930032aa6d5 subrepo: lazier git push logic
Eric Eisner <ede@mit.edu>
parents: 13027
diff changeset
   207
  $ cd gitclone
f930032aa6d5 subrepo: lazier git push logic
Eric Eisner <ede@mit.edu>
parents: 13027
diff changeset
   208
  $ echo ff >> f
f930032aa6d5 subrepo: lazier git push logic
Eric Eisner <ede@mit.edu>
parents: 13027
diff changeset
   209
  $ git commit -q -a -m ff
f930032aa6d5 subrepo: lazier git push logic
Eric Eisner <ede@mit.edu>
parents: 13027
diff changeset
   210
  $ echo fff >> f
f930032aa6d5 subrepo: lazier git push logic
Eric Eisner <ede@mit.edu>
parents: 13027
diff changeset
   211
  $ git commit -q -a -m fff
13091
8cecea387574 test-subrepo-git.t: silence git output
Eric Eisner <ede@mit.edu>
parents: 13087
diff changeset
   212
  $ git push origin testing 2>/dev/null
13029
f930032aa6d5 subrepo: lazier git push logic
Eric Eisner <ede@mit.edu>
parents: 13027
diff changeset
   213
f930032aa6d5 subrepo: lazier git push logic
Eric Eisner <ede@mit.edu>
parents: 13027
diff changeset
   214
make and push changes to hg without updating the subrepo
f930032aa6d5 subrepo: lazier git push logic
Eric Eisner <ede@mit.edu>
parents: 13027
diff changeset
   215
f930032aa6d5 subrepo: lazier git push logic
Eric Eisner <ede@mit.edu>
parents: 13027
diff changeset
   216
  $ cd ../t
20105
c5a0f899e47b tests: deal with new gits sending status messages to stderr
Mads Kiilerich <madski@unity3d.com>
parents: 19811
diff changeset
   217
  $ hg clone . ../td 2>&1 | egrep -v '^Cloning into|^done\.'
13029
f930032aa6d5 subrepo: lazier git push logic
Eric Eisner <ede@mit.edu>
parents: 13027
diff changeset
   218
  updating to branch default
13525
c12088259f64 subrepo: show the source that git clones
Eric Eisner <ede@mit.edu>
parents: 13460
diff changeset
   219
  cloning subrepo s from $TESTTMP/gitroot
13029
f930032aa6d5 subrepo: lazier git push logic
Eric Eisner <ede@mit.edu>
parents: 13027
diff changeset
   220
  checking out detached HEAD in subrepo s
f930032aa6d5 subrepo: lazier git push logic
Eric Eisner <ede@mit.edu>
parents: 13027
diff changeset
   221
  check out a git branch if you intend to make changes
f930032aa6d5 subrepo: lazier git push logic
Eric Eisner <ede@mit.edu>
parents: 13027
diff changeset
   222
  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
f930032aa6d5 subrepo: lazier git push logic
Eric Eisner <ede@mit.edu>
parents: 13027
diff changeset
   223
  $ cd ../td
f930032aa6d5 subrepo: lazier git push logic
Eric Eisner <ede@mit.edu>
parents: 13027
diff changeset
   224
  $ echo aa >> a
f930032aa6d5 subrepo: lazier git push logic
Eric Eisner <ede@mit.edu>
parents: 13027
diff changeset
   225
  $ hg commit -m aa
f930032aa6d5 subrepo: lazier git push logic
Eric Eisner <ede@mit.edu>
parents: 13027
diff changeset
   226
  $ hg push
17022
8a38839ae1dc test-subrepo-git.t: adapt for Windows
Eduard-Cristian Stefan <alexandrul.ct@gmail.com>
parents: 16913
diff changeset
   227
  pushing to $TESTTMP/t (glob)
13029
f930032aa6d5 subrepo: lazier git push logic
Eric Eisner <ede@mit.edu>
parents: 13027
diff changeset
   228
  searching for changes
f930032aa6d5 subrepo: lazier git push logic
Eric Eisner <ede@mit.edu>
parents: 13027
diff changeset
   229
  adding changesets
f930032aa6d5 subrepo: lazier git push logic
Eric Eisner <ede@mit.edu>
parents: 13027
diff changeset
   230
  adding manifests
f930032aa6d5 subrepo: lazier git push logic
Eric Eisner <ede@mit.edu>
parents: 13027
diff changeset
   231
  adding file changes
f930032aa6d5 subrepo: lazier git push logic
Eric Eisner <ede@mit.edu>
parents: 13027
diff changeset
   232
  added 1 changesets with 1 changes to 1 files
f930032aa6d5 subrepo: lazier git push logic
Eric Eisner <ede@mit.edu>
parents: 13027
diff changeset
   233
13087
cca0779b4832 subrepo: lazily update git's local tracking branches
Eric Eisner <ede@mit.edu>
parents: 13029
diff changeset
   234
sync to upstream git, distribute changes
cca0779b4832 subrepo: lazily update git's local tracking branches
Eric Eisner <ede@mit.edu>
parents: 13029
diff changeset
   235
cca0779b4832 subrepo: lazily update git's local tracking branches
Eric Eisner <ede@mit.edu>
parents: 13029
diff changeset
   236
  $ cd ../ta
cca0779b4832 subrepo: lazily update git's local tracking branches
Eric Eisner <ede@mit.edu>
parents: 13029
diff changeset
   237
  $ hg pull -u -q
cca0779b4832 subrepo: lazily update git's local tracking branches
Eric Eisner <ede@mit.edu>
parents: 13029
diff changeset
   238
  $ cd s
13091
8cecea387574 test-subrepo-git.t: silence git output
Eric Eisner <ede@mit.edu>
parents: 13087
diff changeset
   239
  $ 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
   240
  $ cd ..
cca0779b4832 subrepo: lazily update git's local tracking branches
Eric Eisner <ede@mit.edu>
parents: 13029
diff changeset
   241
  $ hg commit -m 'git upstream sync'
cca0779b4832 subrepo: lazily update git's local tracking branches
Eric Eisner <ede@mit.edu>
parents: 13029
diff changeset
   242
  $ hg debugsub
cca0779b4832 subrepo: lazily update git's local tracking branches
Eric Eisner <ede@mit.edu>
parents: 13029
diff changeset
   243
  path s
cca0779b4832 subrepo: lazily update git's local tracking branches
Eric Eisner <ede@mit.edu>
parents: 13029
diff changeset
   244
   source   ../gitroot
cca0779b4832 subrepo: lazily update git's local tracking branches
Eric Eisner <ede@mit.edu>
parents: 13029
diff changeset
   245
   revision 32a343883b74769118bb1d3b4b1fbf9156f4dddc
cca0779b4832 subrepo: lazily update git's local tracking branches
Eric Eisner <ede@mit.edu>
parents: 13029
diff changeset
   246
  $ hg push -q
cca0779b4832 subrepo: lazily update git's local tracking branches
Eric Eisner <ede@mit.edu>
parents: 13029
diff changeset
   247
cca0779b4832 subrepo: lazily update git's local tracking branches
Eric Eisner <ede@mit.edu>
parents: 13029
diff changeset
   248
  $ cd ../tb
cca0779b4832 subrepo: lazily update git's local tracking branches
Eric Eisner <ede@mit.edu>
parents: 13029
diff changeset
   249
  $ hg pull -q
13091
8cecea387574 test-subrepo-git.t: silence git output
Eric Eisner <ede@mit.edu>
parents: 13087
diff changeset
   250
  $ hg update 2>/dev/null
13569
3ab3b892d223 subrepo: show the source that git pulls
Eric Eisner <ede@mit.edu>
parents: 13560
diff changeset
   251
  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
   252
  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
   253
  $ hg debugsub
cca0779b4832 subrepo: lazily update git's local tracking branches
Eric Eisner <ede@mit.edu>
parents: 13029
diff changeset
   254
  path s
cca0779b4832 subrepo: lazily update git's local tracking branches
Eric Eisner <ede@mit.edu>
parents: 13029
diff changeset
   255
   source   ../gitroot
cca0779b4832 subrepo: lazily update git's local tracking branches
Eric Eisner <ede@mit.edu>
parents: 13029
diff changeset
   256
   revision 32a343883b74769118bb1d3b4b1fbf9156f4dddc
cca0779b4832 subrepo: lazily update git's local tracking branches
Eric Eisner <ede@mit.edu>
parents: 13029
diff changeset
   257
19013
2b34d004e644 subrepo: add regression test for issue3870
Kevin Bullock <kbullock@ringworld.org>
parents: 18109
diff changeset
   258
create a new git branch
2b34d004e644 subrepo: add regression test for issue3870
Kevin Bullock <kbullock@ringworld.org>
parents: 18109
diff changeset
   259
2b34d004e644 subrepo: add regression test for issue3870
Kevin Bullock <kbullock@ringworld.org>
parents: 18109
diff changeset
   260
  $ cd s
2b34d004e644 subrepo: add regression test for issue3870
Kevin Bullock <kbullock@ringworld.org>
parents: 18109
diff changeset
   261
  $ git checkout -b b2
2b34d004e644 subrepo: add regression test for issue3870
Kevin Bullock <kbullock@ringworld.org>
parents: 18109
diff changeset
   262
  Switched to a new branch 'b2'
2b34d004e644 subrepo: add regression test for issue3870
Kevin Bullock <kbullock@ringworld.org>
parents: 18109
diff changeset
   263
  $ echo a>a
2b34d004e644 subrepo: add regression test for issue3870
Kevin Bullock <kbullock@ringworld.org>
parents: 18109
diff changeset
   264
  $ git add a
2b34d004e644 subrepo: add regression test for issue3870
Kevin Bullock <kbullock@ringworld.org>
parents: 18109
diff changeset
   265
  $ git commit -qm 'add a'
2b34d004e644 subrepo: add regression test for issue3870
Kevin Bullock <kbullock@ringworld.org>
parents: 18109
diff changeset
   266
  $ cd ..
2b34d004e644 subrepo: add regression test for issue3870
Kevin Bullock <kbullock@ringworld.org>
parents: 18109
diff changeset
   267
  $ hg commit -m 'add branch in s'
2b34d004e644 subrepo: add regression test for issue3870
Kevin Bullock <kbullock@ringworld.org>
parents: 18109
diff changeset
   268
2b34d004e644 subrepo: add regression test for issue3870
Kevin Bullock <kbullock@ringworld.org>
parents: 18109
diff changeset
   269
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
   270
(issue3870)
2b34d004e644 subrepo: add regression test for issue3870
Kevin Bullock <kbullock@ringworld.org>
parents: 18109
diff changeset
   271
  $ cd ../td/s
2b34d004e644 subrepo: add regression test for issue3870
Kevin Bullock <kbullock@ringworld.org>
parents: 18109
diff changeset
   272
  $ 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
   273
  $ git branch --no-track oldtesting
19013
2b34d004e644 subrepo: add regression test for issue3870
Kevin Bullock <kbullock@ringworld.org>
parents: 18109
diff changeset
   274
  $ cd ..
2b34d004e644 subrepo: add regression test for issue3870
Kevin Bullock <kbullock@ringworld.org>
parents: 18109
diff changeset
   275
  $ hg pull -q ../tb
2b34d004e644 subrepo: add regression test for issue3870
Kevin Bullock <kbullock@ringworld.org>
parents: 18109
diff changeset
   276
  $ hg up
2b34d004e644 subrepo: add regression test for issue3870
Kevin Bullock <kbullock@ringworld.org>
parents: 18109
diff changeset
   277
  From $TESTTMP/tb/s
2b34d004e644 subrepo: add regression test for issue3870
Kevin Bullock <kbullock@ringworld.org>
parents: 18109
diff changeset
   278
   * [new branch]      b2         -> origin/b2
2b34d004e644 subrepo: add regression test for issue3870
Kevin Bullock <kbullock@ringworld.org>
parents: 18109
diff changeset
   279
  Previous HEAD position was f47b465... merge
2b34d004e644 subrepo: add regression test for issue3870
Kevin Bullock <kbullock@ringworld.org>
parents: 18109
diff changeset
   280
  Switched to a new branch 'b2'
2b34d004e644 subrepo: add regression test for issue3870
Kevin Bullock <kbullock@ringworld.org>
parents: 18109
diff changeset
   281
  pulling subrepo s from $TESTTMP/tb/s
2b34d004e644 subrepo: add regression test for issue3870
Kevin Bullock <kbullock@ringworld.org>
parents: 18109
diff changeset
   282
  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
   283
12996
3a42651b0a62 subrepo: removing (and restoring) git subrepo state
Eric Eisner <ede@mit.edu>
parents: 12995
diff changeset
   284
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
   285
3a42651b0a62 subrepo: removing (and restoring) git subrepo state
Eric Eisner <ede@mit.edu>
parents: 12995
diff changeset
   286
  $ cd ../t
3a42651b0a62 subrepo: removing (and restoring) git subrepo state
Eric Eisner <ede@mit.edu>
parents: 12995
diff changeset
   287
  $ hg up 0
3a42651b0a62 subrepo: removing (and restoring) git subrepo state
Eric Eisner <ede@mit.edu>
parents: 12995
diff changeset
   288
  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
   289
  $ ls -a s
12996
3a42651b0a62 subrepo: removing (and restoring) git subrepo state
Eric Eisner <ede@mit.edu>
parents: 12995
diff changeset
   290
  .
3a42651b0a62 subrepo: removing (and restoring) git subrepo state
Eric Eisner <ede@mit.edu>
parents: 12995
diff changeset
   291
  ..
3a42651b0a62 subrepo: removing (and restoring) git subrepo state
Eric Eisner <ede@mit.edu>
parents: 12995
diff changeset
   292
  .git
3a42651b0a62 subrepo: removing (and restoring) git subrepo state
Eric Eisner <ede@mit.edu>
parents: 12995
diff changeset
   293
3a42651b0a62 subrepo: removing (and restoring) git subrepo state
Eric Eisner <ede@mit.edu>
parents: 12995
diff changeset
   294
  $ hg up 2
3a42651b0a62 subrepo: removing (and restoring) git subrepo state
Eric Eisner <ede@mit.edu>
parents: 12995
diff changeset
   295
  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
   296
  $ ls -a s
12996
3a42651b0a62 subrepo: removing (and restoring) git subrepo state
Eric Eisner <ede@mit.edu>
parents: 12995
diff changeset
   297
  .
3a42651b0a62 subrepo: removing (and restoring) git subrepo state
Eric Eisner <ede@mit.edu>
parents: 12995
diff changeset
   298
  ..
3a42651b0a62 subrepo: removing (and restoring) git subrepo state
Eric Eisner <ede@mit.edu>
parents: 12995
diff changeset
   299
  .git
3a42651b0a62 subrepo: removing (and restoring) git subrepo state
Eric Eisner <ede@mit.edu>
parents: 12995
diff changeset
   300
  g
13027
7f2ecb64140d subrepo: archive git subrepos
Eric Eisner <ede@mit.edu>
parents: 13010
diff changeset
   301
7f2ecb64140d subrepo: archive git subrepos
Eric Eisner <ede@mit.edu>
parents: 13010
diff changeset
   302
archive subrepos
7f2ecb64140d subrepo: archive git subrepos
Eric Eisner <ede@mit.edu>
parents: 13010
diff changeset
   303
13091
8cecea387574 test-subrepo-git.t: silence git output
Eric Eisner <ede@mit.edu>
parents: 13087
diff changeset
   304
  $ cd ../tc
8cecea387574 test-subrepo-git.t: silence git output
Eric Eisner <ede@mit.edu>
parents: 13087
diff changeset
   305
  $ hg pull -q
8cecea387574 test-subrepo-git.t: silence git output
Eric Eisner <ede@mit.edu>
parents: 13087
diff changeset
   306
  $ 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
   307
  pulling subrepo s from $TESTTMP/gitroot
13027
7f2ecb64140d subrepo: archive git subrepos
Eric Eisner <ede@mit.edu>
parents: 13010
diff changeset
   308
  $ cd ../archive
7f2ecb64140d subrepo: archive git subrepos
Eric Eisner <ede@mit.edu>
parents: 13010
diff changeset
   309
  $ cat s/f
7f2ecb64140d subrepo: archive git subrepos
Eric Eisner <ede@mit.edu>
parents: 13010
diff changeset
   310
  f
7f2ecb64140d subrepo: archive git subrepos
Eric Eisner <ede@mit.edu>
parents: 13010
diff changeset
   311
  $ cat s/g
7f2ecb64140d subrepo: archive git subrepos
Eric Eisner <ede@mit.edu>
parents: 13010
diff changeset
   312
  g
7f2ecb64140d subrepo: archive git subrepos
Eric Eisner <ede@mit.edu>
parents: 13010
diff changeset
   313
  gg
7f2ecb64140d subrepo: archive git subrepos
Eric Eisner <ede@mit.edu>
parents: 13010
diff changeset
   314
  ggg
13181
413bef846806 subrepo: fix subrelpath for git subrepos
Eric Eisner <ede@mit.edu>
parents: 13111
diff changeset
   315
17108
1894dac619de subrepo: propagate matcher to subrepos when archiving
Matt Harbison <matt_harbison@yahoo.com>
parents: 17022
diff changeset
   316
  $ 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
   317
  $ 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
   318
  ../archive_x
1894dac619de subrepo: propagate matcher to subrepos when archiving
Matt Harbison <matt_harbison@yahoo.com>
parents: 17022
diff changeset
   319
  ../archive_x/.hg_archival.txt
1894dac619de subrepo: propagate matcher to subrepos when archiving
Matt Harbison <matt_harbison@yahoo.com>
parents: 17022
diff changeset
   320
  ../archive_x/.hgsub
1894dac619de subrepo: propagate matcher to subrepos when archiving
Matt Harbison <matt_harbison@yahoo.com>
parents: 17022
diff changeset
   321
  ../archive_x/.hgsubstate
1894dac619de subrepo: propagate matcher to subrepos when archiving
Matt Harbison <matt_harbison@yahoo.com>
parents: 17022
diff changeset
   322
  ../archive_x/a
1894dac619de subrepo: propagate matcher to subrepos when archiving
Matt Harbison <matt_harbison@yahoo.com>
parents: 17022
diff changeset
   323
  ../archive_x/s
1894dac619de subrepo: propagate matcher to subrepos when archiving
Matt Harbison <matt_harbison@yahoo.com>
parents: 17022
diff changeset
   324
  ../archive_x/s/g
1894dac619de subrepo: propagate matcher to subrepos when archiving
Matt Harbison <matt_harbison@yahoo.com>
parents: 17022
diff changeset
   325
13181
413bef846806 subrepo: fix subrelpath for git subrepos
Eric Eisner <ede@mit.edu>
parents: 13111
diff changeset
   326
create nested repo
413bef846806 subrepo: fix subrelpath for git subrepos
Eric Eisner <ede@mit.edu>
parents: 13111
diff changeset
   327
413bef846806 subrepo: fix subrelpath for git subrepos
Eric Eisner <ede@mit.edu>
parents: 13111
diff changeset
   328
  $ cd ..
413bef846806 subrepo: fix subrelpath for git subrepos
Eric Eisner <ede@mit.edu>
parents: 13111
diff changeset
   329
  $ hg init outer
413bef846806 subrepo: fix subrelpath for git subrepos
Eric Eisner <ede@mit.edu>
parents: 13111
diff changeset
   330
  $ cd outer
413bef846806 subrepo: fix subrelpath for git subrepos
Eric Eisner <ede@mit.edu>
parents: 13111
diff changeset
   331
  $ echo b>b
413bef846806 subrepo: fix subrelpath for git subrepos
Eric Eisner <ede@mit.edu>
parents: 13111
diff changeset
   332
  $ hg add b
413bef846806 subrepo: fix subrelpath for git subrepos
Eric Eisner <ede@mit.edu>
parents: 13111
diff changeset
   333
  $ hg commit -m b
413bef846806 subrepo: fix subrelpath for git subrepos
Eric Eisner <ede@mit.edu>
parents: 13111
diff changeset
   334
20105
c5a0f899e47b tests: deal with new gits sending status messages to stderr
Mads Kiilerich <madski@unity3d.com>
parents: 19811
diff changeset
   335
  $ hg clone ../t inner 2> /dev/null
13181
413bef846806 subrepo: fix subrelpath for git subrepos
Eric Eisner <ede@mit.edu>
parents: 13111
diff changeset
   336
  updating to branch default
13525
c12088259f64 subrepo: show the source that git clones
Eric Eisner <ede@mit.edu>
parents: 13460
diff changeset
   337
  cloning subrepo s from $TESTTMP/gitroot
13181
413bef846806 subrepo: fix subrelpath for git subrepos
Eric Eisner <ede@mit.edu>
parents: 13111
diff changeset
   338
  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
   339
  $ echo inner = inner > .hgsub
413bef846806 subrepo: fix subrelpath for git subrepos
Eric Eisner <ede@mit.edu>
parents: 13111
diff changeset
   340
  $ hg add .hgsub
413bef846806 subrepo: fix subrelpath for git subrepos
Eric Eisner <ede@mit.edu>
parents: 13111
diff changeset
   341
  $ hg commit -m 'nested sub'
413bef846806 subrepo: fix subrelpath for git subrepos
Eric Eisner <ede@mit.edu>
parents: 13111
diff changeset
   342
413bef846806 subrepo: fix subrelpath for git subrepos
Eric Eisner <ede@mit.edu>
parents: 13111
diff changeset
   343
nested commit
413bef846806 subrepo: fix subrelpath for git subrepos
Eric Eisner <ede@mit.edu>
parents: 13111
diff changeset
   344
413bef846806 subrepo: fix subrelpath for git subrepos
Eric Eisner <ede@mit.edu>
parents: 13111
diff changeset
   345
  $ echo ffff >> inner/s/f
13182
2537bd17421d subrepo: basic support for status of git subrepos
Eric Eisner <ede@mit.edu>
parents: 13181
diff changeset
   346
  $ hg status --subrepos
2537bd17421d subrepo: basic support for status of git subrepos
Eric Eisner <ede@mit.edu>
parents: 13181
diff changeset
   347
  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
   348
  $ hg commit --subrepos -m nested
13181
413bef846806 subrepo: fix subrelpath for git subrepos
Eric Eisner <ede@mit.edu>
parents: 13111
diff changeset
   349
  committing subrepository inner
17022
8a38839ae1dc test-subrepo-git.t: adapt for Windows
Eduard-Cristian Stefan <alexandrul.ct@gmail.com>
parents: 16913
diff changeset
   350
  committing subrepository inner/s (glob)
13181
413bef846806 subrepo: fix subrelpath for git subrepos
Eric Eisner <ede@mit.edu>
parents: 13111
diff changeset
   351
413bef846806 subrepo: fix subrelpath for git subrepos
Eric Eisner <ede@mit.edu>
parents: 13111
diff changeset
   352
nested archive
413bef846806 subrepo: fix subrelpath for git subrepos
Eric Eisner <ede@mit.edu>
parents: 13111
diff changeset
   353
413bef846806 subrepo: fix subrelpath for git subrepos
Eric Eisner <ede@mit.edu>
parents: 13111
diff changeset
   354
  $ 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
   355
  $ 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
   356
  f
413bef846806 subrepo: fix subrelpath for git subrepos
Eric Eisner <ede@mit.edu>
parents: 13111
diff changeset
   357
  g
13324
e5617047c926 subrepo: make update -C clean the working directory for git subrepos
Erik Zielke <ez@aragost.com>
parents: 13296
diff changeset
   358
13460
64bb8e586a92 subrepo: expand relative sources for git subrepos
Eric Eisner <ede@mit.edu>
parents: 13428
diff changeset
   359
relative source expansion
64bb8e586a92 subrepo: expand relative sources for git subrepos
Eric Eisner <ede@mit.edu>
parents: 13428
diff changeset
   360
64bb8e586a92 subrepo: expand relative sources for git subrepos
Eric Eisner <ede@mit.edu>
parents: 13428
diff changeset
   361
  $ cd ..
64bb8e586a92 subrepo: expand relative sources for git subrepos
Eric Eisner <ede@mit.edu>
parents: 13428
diff changeset
   362
  $ mkdir d
20105
c5a0f899e47b tests: deal with new gits sending status messages to stderr
Mads Kiilerich <madski@unity3d.com>
parents: 19811
diff changeset
   363
  $ 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
   364
  updating to branch default
13525
c12088259f64 subrepo: show the source that git clones
Eric Eisner <ede@mit.edu>
parents: 13460
diff changeset
   365
  cloning subrepo s from $TESTTMP/gitroot
13460
64bb8e586a92 subrepo: expand relative sources for git subrepos
Eric Eisner <ede@mit.edu>
parents: 13428
diff changeset
   366
  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
   367
13553
dea6efdd7ec4 subrepo: don't crash when git repo is missing
Eric Eisner <ede@mit.edu>
parents: 13460
diff changeset
   368
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
   369
dea6efdd7ec4 subrepo: don't crash when git repo is missing
Eric Eisner <ede@mit.edu>
parents: 13460
diff changeset
   370
  $ hg clone t missing -q
dea6efdd7ec4 subrepo: don't crash when git repo is missing
Eric Eisner <ede@mit.edu>
parents: 13460
diff changeset
   371
  $ cd missing
dea6efdd7ec4 subrepo: don't crash when git repo is missing
Eric Eisner <ede@mit.edu>
parents: 13460
diff changeset
   372
  $ rm -rf s
dea6efdd7ec4 subrepo: don't crash when git repo is missing
Eric Eisner <ede@mit.edu>
parents: 13460
diff changeset
   373
  $ hg status -S
dea6efdd7ec4 subrepo: don't crash when git repo is missing
Eric Eisner <ede@mit.edu>
parents: 13460
diff changeset
   374
  $ hg sum | grep commit
dea6efdd7ec4 subrepo: don't crash when git repo is missing
Eric Eisner <ede@mit.edu>
parents: 13460
diff changeset
   375
  commit: 1 subrepos
dea6efdd7ec4 subrepo: don't crash when git repo is missing
Eric Eisner <ede@mit.edu>
parents: 13460
diff changeset
   376
  $ hg push -q
18109
9e3910db4e78 subrepo: append subrepo path to subrepo error messages
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 17345
diff changeset
   377
  abort: subrepo s is missing (in subrepo s)
13553
dea6efdd7ec4 subrepo: don't crash when git repo is missing
Eric Eisner <ede@mit.edu>
parents: 13460
diff changeset
   378
  [255]
15321
e174353e8cda subrepos: abort commit by default if a subrepo is dirty (BC)
Martin Geisler <mg@lazybytes.net>
parents: 14481
diff changeset
   379
  $ hg commit --subrepos -qm missing
18109
9e3910db4e78 subrepo: append subrepo path to subrepo error messages
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 17345
diff changeset
   380
  abort: subrepo s is missing (in subrepo s)
13553
dea6efdd7ec4 subrepo: don't crash when git repo is missing
Eric Eisner <ede@mit.edu>
parents: 13460
diff changeset
   381
  [255]
20105
c5a0f899e47b tests: deal with new gits sending status messages to stderr
Mads Kiilerich <madski@unity3d.com>
parents: 19811
diff changeset
   382
  $ hg update -C 2> /dev/null
13560
a2734c8322ac merge with stable
Patrick Mezard <pmezard@gmail.com>
parents: 13558
diff changeset
   383
  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
   384
  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
   385
  $ hg sum | grep commit
dea6efdd7ec4 subrepo: don't crash when git repo is missing
Eric Eisner <ede@mit.edu>
parents: 13460
diff changeset
   386
  commit: (clean)
dea6efdd7ec4 subrepo: don't crash when git repo is missing
Eric Eisner <ede@mit.edu>
parents: 13460
diff changeset
   387
14469
2fdea636f254 subrepo: don't crash when git .hgsubstate is empty (issue2716)
Eric Eisner <ede@alum.mit.edu>
parents: 13553
diff changeset
   388
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
   389
2fdea636f254 subrepo: don't crash when git .hgsubstate is empty (issue2716)
Eric Eisner <ede@alum.mit.edu>
parents: 13553
diff changeset
   390
  $ 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
   391
  $ hg rm .hgsubstate
2fdea636f254 subrepo: don't crash when git .hgsubstate is empty (issue2716)
Eric Eisner <ede@alum.mit.edu>
parents: 13553
diff changeset
   392
  $ 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
   393
  nothing changed
b254f827b7a6 subrepo: rewrite handling of subrepo state at commit (issue2403)
Matt Mackall <mpm@selenic.com>
parents: 15531
diff changeset
   394
  [1]
14469
2fdea636f254 subrepo: don't crash when git .hgsubstate is empty (issue2716)
Eric Eisner <ede@alum.mit.edu>
parents: 13553
diff changeset
   395
  $ 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
   396
  $ hg manifest
2fdea636f254 subrepo: don't crash when git .hgsubstate is empty (issue2716)
Eric Eisner <ede@alum.mit.edu>
parents: 13553
diff changeset
   397
  .hgsub
16073
b254f827b7a6 subrepo: rewrite handling of subrepo state at commit (issue2403)
Matt Mackall <mpm@selenic.com>
parents: 15531
diff changeset
   398
  .hgsubstate
14469
2fdea636f254 subrepo: don't crash when git .hgsubstate is empty (issue2716)
Eric Eisner <ede@alum.mit.edu>
parents: 13553
diff changeset
   399
  a
2fdea636f254 subrepo: don't crash when git .hgsubstate is empty (issue2716)
Eric Eisner <ede@alum.mit.edu>
parents: 13553
diff changeset
   400
2fdea636f254 subrepo: don't crash when git .hgsubstate is empty (issue2716)
Eric Eisner <ede@alum.mit.edu>
parents: 13553
diff changeset
   401
  $ hg status -S
16073
b254f827b7a6 subrepo: rewrite handling of subrepo state at commit (issue2403)
Matt Mackall <mpm@selenic.com>
parents: 15531
diff changeset
   402
  R .hgsubstate
14469
2fdea636f254 subrepo: don't crash when git .hgsubstate is empty (issue2716)
Eric Eisner <ede@alum.mit.edu>
parents: 13553
diff changeset
   403
  $ hg sum | grep commit
16073
b254f827b7a6 subrepo: rewrite handling of subrepo state at commit (issue2403)
Matt Mackall <mpm@selenic.com>
parents: 15531
diff changeset
   404
  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
   405
2fdea636f254 subrepo: don't crash when git .hgsubstate is empty (issue2716)
Eric Eisner <ede@alum.mit.edu>
parents: 13553
diff changeset
   406
  $ 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
   407
  nothing changed
b254f827b7a6 subrepo: rewrite handling of subrepo state at commit (issue2403)
Matt Mackall <mpm@selenic.com>
parents: 15531
diff changeset
   408
  [1]
14469
2fdea636f254 subrepo: don't crash when git .hgsubstate is empty (issue2716)
Eric Eisner <ede@alum.mit.edu>
parents: 13553
diff changeset
   409
  $ hg manifest
2fdea636f254 subrepo: don't crash when git .hgsubstate is empty (issue2716)
Eric Eisner <ede@alum.mit.edu>
parents: 13553
diff changeset
   410
  .hgsub
2fdea636f254 subrepo: don't crash when git .hgsubstate is empty (issue2716)
Eric Eisner <ede@alum.mit.edu>
parents: 13553
diff changeset
   411
  .hgsubstate
2fdea636f254 subrepo: don't crash when git .hgsubstate is empty (issue2716)
Eric Eisner <ede@alum.mit.edu>
parents: 13553
diff changeset
   412
  a
2fdea636f254 subrepo: don't crash when git .hgsubstate is empty (issue2716)
Eric Eisner <ede@alum.mit.edu>
parents: 13553
diff changeset
   413
  $ hg sum | grep commit
16073
b254f827b7a6 subrepo: rewrite handling of subrepo state at commit (issue2403)
Matt Mackall <mpm@selenic.com>
parents: 15531
diff changeset
   414
  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
   415
2fdea636f254 subrepo: don't crash when git .hgsubstate is empty (issue2716)
Eric Eisner <ede@alum.mit.edu>
parents: 13553
diff changeset
   416
  $ 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
   417
  $ ls s
16073
b254f827b7a6 subrepo: rewrite handling of subrepo state at commit (issue2403)
Matt Mackall <mpm@selenic.com>
parents: 15531
diff changeset
   418
  g
14469
2fdea636f254 subrepo: don't crash when git .hgsubstate is empty (issue2716)
Eric Eisner <ede@alum.mit.edu>
parents: 13553
diff changeset
   419
15531
0810ccc51f0a subrepo: fix git status false positive (issue3109)
Eric Roshan Eisner <ede@alum.mit.edu>
parents: 15321
diff changeset
   420
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
   421
0810ccc51f0a subrepo: fix git status false positive (issue3109)
Eric Roshan Eisner <ede@alum.mit.edu>
parents: 15321
diff changeset
   422
  $ hg update -q
0810ccc51f0a subrepo: fix git status false positive (issue3109)
Eric Roshan Eisner <ede@alum.mit.edu>
parents: 15321
diff changeset
   423
  $ touch -t 200001010000 s/g
0810ccc51f0a subrepo: fix git status false positive (issue3109)
Eric Roshan Eisner <ede@alum.mit.edu>
parents: 15321
diff changeset
   424
  $ hg status --subrepos
0810ccc51f0a subrepo: fix git status false positive (issue3109)
Eric Roshan Eisner <ede@alum.mit.edu>
parents: 15321
diff changeset
   425
  $ touch -t 200001010000 s/g
0810ccc51f0a subrepo: fix git status false positive (issue3109)
Eric Roshan Eisner <ede@alum.mit.edu>
parents: 15321
diff changeset
   426
  $ hg sum | grep commit
0810ccc51f0a subrepo: fix git status false positive (issue3109)
Eric Roshan Eisner <ede@alum.mit.edu>
parents: 15321
diff changeset
   427
  commit: (clean)
0810ccc51f0a subrepo: fix git status false positive (issue3109)
Eric Roshan Eisner <ede@alum.mit.edu>
parents: 15321
diff changeset
   428
13324
e5617047c926 subrepo: make update -C clean the working directory for git subrepos
Erik Zielke <ez@aragost.com>
parents: 13296
diff changeset
   429
Check hg update --clean
13331
9f2c6892e004 test-subrepo-git.t: make compatible with old git
Eric Eisner <ede@mit.edu>
parents: 13324
diff changeset
   430
  $ 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
   431
  $ echo  > s/g
e5617047c926 subrepo: make update -C clean the working directory for git subrepos
Erik Zielke <ez@aragost.com>
parents: 13296
diff changeset
   432
  $ cd s
e5617047c926 subrepo: make update -C clean the working directory for git subrepos
Erik Zielke <ez@aragost.com>
parents: 13296
diff changeset
   433
  $ echo c1 > f1
e5617047c926 subrepo: make update -C clean the working directory for git subrepos
Erik Zielke <ez@aragost.com>
parents: 13296
diff changeset
   434
  $ echo c1 > f2
e5617047c926 subrepo: make update -C clean the working directory for git subrepos
Erik Zielke <ez@aragost.com>
parents: 13296
diff changeset
   435
  $ git add f1
e5617047c926 subrepo: make update -C clean the working directory for git subrepos
Erik Zielke <ez@aragost.com>
parents: 13296
diff changeset
   436
  $ cd ..
13331
9f2c6892e004 test-subrepo-git.t: make compatible with old git
Eric Eisner <ede@mit.edu>
parents: 13324
diff changeset
   437
  $ hg status -S
9f2c6892e004 test-subrepo-git.t: make compatible with old git
Eric Eisner <ede@mit.edu>
parents: 13324
diff changeset
   438
  M s/g
9f2c6892e004 test-subrepo-git.t: make compatible with old git
Eric Eisner <ede@mit.edu>
parents: 13324
diff changeset
   439
  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
   440
  ? s/f2
13331
9f2c6892e004 test-subrepo-git.t: make compatible with old git
Eric Eisner <ede@mit.edu>
parents: 13324
diff changeset
   441
  $ ls s
9f2c6892e004 test-subrepo-git.t: make compatible with old git
Eric Eisner <ede@mit.edu>
parents: 13324
diff changeset
   442
  f
9f2c6892e004 test-subrepo-git.t: make compatible with old git
Eric Eisner <ede@mit.edu>
parents: 13324
diff changeset
   443
  f1
9f2c6892e004 test-subrepo-git.t: make compatible with old git
Eric Eisner <ede@mit.edu>
parents: 13324
diff changeset
   444
  f2
9f2c6892e004 test-subrepo-git.t: make compatible with old git
Eric Eisner <ede@mit.edu>
parents: 13324
diff changeset
   445
  g
9f2c6892e004 test-subrepo-git.t: make compatible with old git
Eric Eisner <ede@mit.edu>
parents: 13324
diff changeset
   446
  $ hg update --clean
9f2c6892e004 test-subrepo-git.t: make compatible with old git
Eric Eisner <ede@mit.edu>
parents: 13324
diff changeset
   447
  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
   448
  $ 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
   449
  ? s/f1
2d86f4e38c08 subrepo: add status support for ignored files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 22590
diff changeset
   450
  ? s/f2
13331
9f2c6892e004 test-subrepo-git.t: make compatible with old git
Eric Eisner <ede@mit.edu>
parents: 13324
diff changeset
   451
  $ ls s
9f2c6892e004 test-subrepo-git.t: make compatible with old git
Eric Eisner <ede@mit.edu>
parents: 13324
diff changeset
   452
  f
9f2c6892e004 test-subrepo-git.t: make compatible with old git
Eric Eisner <ede@mit.edu>
parents: 13324
diff changeset
   453
  f1
9f2c6892e004 test-subrepo-git.t: make compatible with old git
Eric Eisner <ede@mit.edu>
parents: 13324
diff changeset
   454
  f2
9f2c6892e004 test-subrepo-git.t: make compatible with old git
Eric Eisner <ede@mit.edu>
parents: 13324
diff changeset
   455
  g
13417
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   456
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   457
Sticky subrepositories, no changes
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   458
  $ cd $TESTTMP/ta
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   459
  $ hg id -n
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   460
  7
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   461
  $ cd s
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   462
  $ git rev-parse HEAD
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   463
  32a343883b74769118bb1d3b4b1fbf9156f4dddc
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   464
  $ cd ..
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   465
  $ 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
   466
  $ hg id -n
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   467
  1
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   468
  $ cd s
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   469
  $ git rev-parse HEAD
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   470
  da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   471
  $ cd ..
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   472
21024
7731a2281cf0 spelling: fixes from spell checker
Mads Kiilerich <madski@unity3d.com>
parents: 20105
diff changeset
   473
Sticky subrepositories, file changes
13417
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   474
  $ touch s/f1
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   475
  $ cd s
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   476
  $ git add f1
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   477
  $ cd ..
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   478
  $ hg id -n
17255
3e856d8abe9c identity: show trailing '+' for dirty subrepos (issue2839)
Patrick Mezard <patrick@mezard.eu>
parents: 17114
diff changeset
   479
  1+
13417
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   480
  $ cd s
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   481
  $ git rev-parse HEAD
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   482
  da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   483
  $ cd ..
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   484
  $ 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
   485
   subrepository s diverged (local revision: da5f5b1, remote revision: aa84837)
19811
5e10d41e7b9c merge: let the user choose to merge, keep local or keep remote subrepo revisions
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 19049
diff changeset
   486
  (M)erge, keep (l)ocal or keep (r)emote? m
13417
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   487
   subrepository sources for s differ
22590
d4c972b97fee subrepo: remove superfluous newline from subrepo prompt
Mads Kiilerich <madski@unity3d.com>
parents: 22046
diff changeset
   488
  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
   489
  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
   490
  $ hg id -n
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   491
  4+
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   492
  $ cd s
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   493
  $ git rev-parse HEAD
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   494
  da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   495
  $ cd ..
17345
4f8054d3171b check-code: fix check for trailing whitespace on sh command lines
Mads Kiilerich <mads@kiilerich.com>
parents: 17255
diff changeset
   496
  $ 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
   497
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   498
Sticky subrepository, revision updates
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   499
  $ hg id -n
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   500
  7
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   501
  $ cd s
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   502
  $ git rev-parse HEAD
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   503
  32a343883b74769118bb1d3b4b1fbf9156f4dddc
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   504
  $ cd ..
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   505
  $ cd s
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   506
  $ git checkout aa84837ccfbdfedcdcdeeedc309d73e6eb069edc
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   507
  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
   508
  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
   509
  $ cd ..
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   510
  $ 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
   511
   subrepository s diverged (local revision: 32a3438, remote revision: da5f5b1)
19811
5e10d41e7b9c merge: let the user choose to merge, keep local or keep remote subrepo revisions
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 19049
diff changeset
   512
  (M)erge, keep (l)ocal or keep (r)emote? m
13417
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   513
   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
   514
  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
   515
  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
   516
  $ hg id -n
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   517
  1+
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   518
  $ cd s
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   519
  $ git rev-parse HEAD
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   520
  aa84837ccfbdfedcdcdeeedc309d73e6eb069edc
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   521
  $ cd ..
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   522
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   523
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
   524
  $ touch s/f1
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   525
  $ cd s
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   526
  $ git add f1
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   527
  $ git rev-parse HEAD
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   528
  aa84837ccfbdfedcdcdeeedc309d73e6eb069edc
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   529
  $ cd ..
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   530
  $ hg id -n
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   531
  1+
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   532
  $ 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
   533
   subrepository s diverged (local revision: 32a3438, remote revision: 32a3438)
19811
5e10d41e7b9c merge: let the user choose to merge, keep local or keep remote subrepo revisions
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 19049
diff changeset
   534
  (M)erge, keep (l)ocal or keep (r)emote? m
13417
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   535
   subrepository sources for s differ
22590
d4c972b97fee subrepo: remove superfluous newline from subrepo prompt
Mads Kiilerich <madski@unity3d.com>
parents: 22046
diff changeset
   536
  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
   537
  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
   538
  $ hg id -n
17255
3e856d8abe9c identity: show trailing '+' for dirty subrepos (issue2839)
Patrick Mezard <patrick@mezard.eu>
parents: 17114
diff changeset
   539
  7+
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
  aa84837ccfbdfedcdcdeeedc309d73e6eb069edc
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
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   545
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
   546
  $ 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
   547
  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
   548
  $ hg id -n
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   549
  7
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   550
  $ cd s
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   551
  $ git rev-parse HEAD
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   552
  32a343883b74769118bb1d3b4b1fbf9156f4dddc
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   553
  $ cd ..
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   554
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   555
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
   556
  $ cd s
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   557
  $ git checkout 32a343883b74769118bb1d3b4b1fbf9156f4dddc
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   558
  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
   559
  $ cd ..
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   560
  $ hg update 1
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   561
  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
   562
  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
   563
  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
   564
  $ hg id -n
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   565
  1
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   566
  $ cd s
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   567
  $ git rev-parse HEAD
0748e18be470 subrepos: prompt on conflicts on update with dirty subrepos
Erik Zielke <ez@aragost.com>
parents: 13331
diff changeset
   568
  da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7
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
16527
17a1f7690b49 subrepo: fix default implementation of forget() (issue3404)
Patrick Mezard <patrick@mezard.eu>
parents: 16271
diff changeset
   571
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
   572
traceback
17022
8a38839ae1dc test-subrepo-git.t: adapt for Windows
Eduard-Cristian Stefan <alexandrul.ct@gmail.com>
parents: 16913
diff changeset
   573
#if no-windows
16527
17a1f7690b49 subrepo: fix default implementation of forget() (issue3404)
Patrick Mezard <patrick@mezard.eu>
parents: 16271
diff changeset
   574
  $ hg forget 'notafile*'
17a1f7690b49 subrepo: fix default implementation of forget() (issue3404)
Patrick Mezard <patrick@mezard.eu>
parents: 16271
diff changeset
   575
  notafile*: No such file or directory
17a1f7690b49 subrepo: fix default implementation of forget() (issue3404)
Patrick Mezard <patrick@mezard.eu>
parents: 16271
diff changeset
   576
  [1]
17022
8a38839ae1dc test-subrepo-git.t: adapt for Windows
Eduard-Cristian Stefan <alexandrul.ct@gmail.com>
parents: 16913
diff changeset
   577
#else
8a38839ae1dc test-subrepo-git.t: adapt for Windows
Eduard-Cristian Stefan <alexandrul.ct@gmail.com>
parents: 16913
diff changeset
   578
  $ hg forget 'notafile'
8a38839ae1dc test-subrepo-git.t: adapt for Windows
Eduard-Cristian Stefan <alexandrul.ct@gmail.com>
parents: 16913
diff changeset
   579
  notafile: * (glob)
8a38839ae1dc test-subrepo-git.t: adapt for Windows
Eduard-Cristian Stefan <alexandrul.ct@gmail.com>
parents: 16913
diff changeset
   580
  [1]
8a38839ae1dc test-subrepo-git.t: adapt for Windows
Eduard-Cristian Stefan <alexandrul.ct@gmail.com>
parents: 16913
diff changeset
   581
#endif
16913
f2719b387380 tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents: 16527
diff changeset
   582
f2719b387380 tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents: 16527
diff changeset
   583
  $ cd ..
21564
2e91d4964ecd subrepo: make "_sanitize()" work
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21024
diff changeset
   584
2e91d4964ecd subrepo: make "_sanitize()" work
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21024
diff changeset
   585
Test sanitizing ".hg/hgrc" in subrepo
2e91d4964ecd subrepo: make "_sanitize()" work
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21024
diff changeset
   586
2e91d4964ecd subrepo: make "_sanitize()" work
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21024
diff changeset
   587
  $ cd t
2e91d4964ecd subrepo: make "_sanitize()" work
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21024
diff changeset
   588
  $ hg tip -q
2e91d4964ecd subrepo: make "_sanitize()" work
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21024
diff changeset
   589
  7:af6d2edbb0d3
2e91d4964ecd subrepo: make "_sanitize()" work
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21024
diff changeset
   590
  $ hg update -q -C af6d2edbb0d3
2e91d4964ecd subrepo: make "_sanitize()" work
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21024
diff changeset
   591
  $ cd s
2e91d4964ecd subrepo: make "_sanitize()" work
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21024
diff changeset
   592
  $ git checkout -q -b sanitize-test
2e91d4964ecd subrepo: make "_sanitize()" work
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21024
diff changeset
   593
  $ mkdir .hg
2e91d4964ecd subrepo: make "_sanitize()" work
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21024
diff changeset
   594
  $ echo '.hg/hgrc in git repo' > .hg/hgrc
2e91d4964ecd subrepo: make "_sanitize()" work
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21024
diff changeset
   595
  $ mkdir -p sub/.hg
2e91d4964ecd subrepo: make "_sanitize()" work
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21024
diff changeset
   596
  $ 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
   597
  $ git add .hg sub
2e91d4964ecd subrepo: make "_sanitize()" work
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21024
diff changeset
   598
  $ 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
   599
  $ git push -q origin sanitize-test
2e91d4964ecd subrepo: make "_sanitize()" work
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21024
diff changeset
   600
  $ cd ..
2e91d4964ecd subrepo: make "_sanitize()" work
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21024
diff changeset
   601
  $ grep ' s$' .hgsubstate
2e91d4964ecd subrepo: make "_sanitize()" work
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21024
diff changeset
   602
  32a343883b74769118bb1d3b4b1fbf9156f4dddc s
2e91d4964ecd subrepo: make "_sanitize()" work
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21024
diff changeset
   603
  $ 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
   604
  $ hg parents -q
2e91d4964ecd subrepo: make "_sanitize()" work
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21024
diff changeset
   605
  8:3473d20bddcf
2e91d4964ecd subrepo: make "_sanitize()" work
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21024
diff changeset
   606
  $ grep ' s$' .hgsubstate
2e91d4964ecd subrepo: make "_sanitize()" work
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21024
diff changeset
   607
  c4069473b459cf27fd4d7c2f50c4346b4e936599 s
2e91d4964ecd subrepo: make "_sanitize()" work
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21024
diff changeset
   608
  $ cd ..
2e91d4964ecd subrepo: make "_sanitize()" work
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21024
diff changeset
   609
21566
a01988cd9b61 subrepo: make "_sanitize()" take absolute path to the root of subrepo
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21565
diff changeset
   610
  $ 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
   611
  $ 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
   612
  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
   613
  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
   614
  $ cd tc
2e91d4964ecd subrepo: make "_sanitize()" work
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21024
diff changeset
   615
  $ hg parents -q
2e91d4964ecd subrepo: make "_sanitize()" work
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21024
diff changeset
   616
  8:3473d20bddcf
2e91d4964ecd subrepo: make "_sanitize()" work
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21024
diff changeset
   617
  $ grep ' s$' .hgsubstate
2e91d4964ecd subrepo: make "_sanitize()" work
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21024
diff changeset
   618
  c4069473b459cf27fd4d7c2f50c4346b4e936599 s
21748
8621125a1718 tests: cat error messages are different on Solaris
Danek Duvall <danek.duvall@oracle.com>
parents: 21567
diff changeset
   619
  $ test -f s/.hg/hgrc
21564
2e91d4964ecd subrepo: make "_sanitize()" work
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21024
diff changeset
   620
  [1]
21748
8621125a1718 tests: cat error messages are different on Solaris
Danek Duvall <danek.duvall@oracle.com>
parents: 21567
diff changeset
   621
  $ test -f s/sub/.hg/hgrc
21564
2e91d4964ecd subrepo: make "_sanitize()" work
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21024
diff changeset
   622
  [1]
2e91d4964ecd subrepo: make "_sanitize()" work
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21024
diff changeset
   623
  $ cd ..
21565
7f7f634d073d subrepo: invoke "_sanitize()" also after "git merge --ff"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21564
diff changeset
   624
7f7f634d073d subrepo: invoke "_sanitize()" also after "git merge --ff"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21564
diff changeset
   625
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
   626
7f7f634d073d subrepo: invoke "_sanitize()" also after "git merge --ff"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21564
diff changeset
   627
  $ cd t
7f7f634d073d subrepo: invoke "_sanitize()" also after "git merge --ff"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21564
diff changeset
   628
  $ hg tip -q
7f7f634d073d subrepo: invoke "_sanitize()" also after "git merge --ff"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21564
diff changeset
   629
  8:3473d20bddcf
7f7f634d073d subrepo: invoke "_sanitize()" also after "git merge --ff"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21564
diff changeset
   630
  $ 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
   631
  $ cd s
7f7f634d073d subrepo: invoke "_sanitize()" also after "git merge --ff"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21564
diff changeset
   632
  $ git checkout -q testing
7f7f634d073d subrepo: invoke "_sanitize()" also after "git merge --ff"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21564
diff changeset
   633
  $ mkdir .hg
7f7f634d073d subrepo: invoke "_sanitize()" also after "git merge --ff"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21564
diff changeset
   634
  $ 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
   635
  $ mkdir -p sub/.hg
7f7f634d073d subrepo: invoke "_sanitize()" also after "git merge --ff"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21564
diff changeset
   636
  $ 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
   637
  $ git add .hg sub
7f7f634d073d subrepo: invoke "_sanitize()" also after "git merge --ff"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21564
diff changeset
   638
  $ 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
   639
  $ 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
   640
  $ cd ..
7f7f634d073d subrepo: invoke "_sanitize()" also after "git merge --ff"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21564
diff changeset
   641
  $ grep ' s$' .hgsubstate
7f7f634d073d subrepo: invoke "_sanitize()" also after "git merge --ff"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21564
diff changeset
   642
  32a343883b74769118bb1d3b4b1fbf9156f4dddc s
7f7f634d073d subrepo: invoke "_sanitize()" also after "git merge --ff"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21564
diff changeset
   643
  $ 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
   644
  $ hg parents -q
7f7f634d073d subrepo: invoke "_sanitize()" also after "git merge --ff"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21564
diff changeset
   645
  9:ed23f7fe024e
7f7f634d073d subrepo: invoke "_sanitize()" also after "git merge --ff"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21564
diff changeset
   646
  $ grep ' s$' .hgsubstate
7f7f634d073d subrepo: invoke "_sanitize()" also after "git merge --ff"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21564
diff changeset
   647
  f262643c1077219fbd3858d54e78ef050ef84fbf s
7f7f634d073d subrepo: invoke "_sanitize()" also after "git merge --ff"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21564
diff changeset
   648
  $ cd ..
7f7f634d073d subrepo: invoke "_sanitize()" also after "git merge --ff"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21564
diff changeset
   649
7f7f634d073d subrepo: invoke "_sanitize()" also after "git merge --ff"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21564
diff changeset
   650
  $ cd tc
7f7f634d073d subrepo: invoke "_sanitize()" also after "git merge --ff"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21564
diff changeset
   651
  $ 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
   652
  $ 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
   653
  [1]
21748
8621125a1718 tests: cat error messages are different on Solaris
Danek Duvall <danek.duvall@oracle.com>
parents: 21567
diff changeset
   654
  $ 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
   655
  [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
   656
  $ cd ..
a01988cd9b61 subrepo: make "_sanitize()" take absolute path to the root of subrepo
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21565
diff changeset
   657
  $ 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
   658
  $ 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
   659
  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
   660
  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
   661
  $ cd tc
21565
7f7f634d073d subrepo: invoke "_sanitize()" also after "git merge --ff"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21564
diff changeset
   662
  $ hg parents -q
7f7f634d073d subrepo: invoke "_sanitize()" also after "git merge --ff"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21564
diff changeset
   663
  9:ed23f7fe024e
7f7f634d073d subrepo: invoke "_sanitize()" also after "git merge --ff"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21564
diff changeset
   664
  $ grep ' s$' .hgsubstate
7f7f634d073d subrepo: invoke "_sanitize()" also after "git merge --ff"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21564
diff changeset
   665
  f262643c1077219fbd3858d54e78ef050ef84fbf s
21748
8621125a1718 tests: cat error messages are different on Solaris
Danek Duvall <danek.duvall@oracle.com>
parents: 21567
diff changeset
   666
  $ 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
   667
  [1]
21748
8621125a1718 tests: cat error messages are different on Solaris
Danek Duvall <danek.duvall@oracle.com>
parents: 21567
diff changeset
   668
  $ 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
   669
  [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
   670
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
   671
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
   672
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
   673
  $ 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
   674
  $ 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
   675
  $ hg update -q -C af6d2edbb0d3
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
   676
  checking out detached HEAD in subrepo s
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
   677
  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
   678
23523
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   679
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
   680
  $ cd s
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   681
  $ cat > foobar << EOF
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   682
  > woopwoop
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   683
  > 
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   684
  > foo
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   685
  > bar
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   686
  > EOF
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   687
  $ git add foobar
21565
7f7f634d073d subrepo: invoke "_sanitize()" also after "git merge --ff"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21564
diff changeset
   688
  $ cd ..
23523
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   689
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   690
  $ hg diff --subrepos
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   691
  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
   692
  new file mode 100644
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   693
  index 0000000..8a5a5e2
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   694
  --- /dev/null
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   695
  +++ b/s/foobar
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   696
  @@ -0,0 +1,4 @@
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   697
  +woopwoop
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   698
  +
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   699
  +foo
23938
de519517f597 subrepo: correctly add newline for git subrepo diffs
Mathias De Maré <mathias.demare@gmail.com>
parents: 23937
diff changeset
   700
  +bar
23523
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   701
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   702
  $ 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
   703
  committing subrepository s
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   704
  created new head
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   705
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   706
  $ 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
   707
  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
   708
  --- a/.hgsubstate
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   709
  +++ b/.hgsubstate
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   710
  @@ -1,1 +1,1 @@
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   711
  -32a343883b74769118bb1d3b4b1fbf9156f4dddc s
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   712
  +fd4dbf828a5b2fcd36b2bcf21ea773820970d129 s
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   713
  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
   714
  new file mode 100644
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   715
  index 0000000..8a5a5e2
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   716
  --- /dev/null
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   717
  +++ b/s/foobar
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   718
  @@ -0,0 +1,4 @@
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   719
  +woopwoop
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   720
  +
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   721
  +foo
23938
de519517f597 subrepo: correctly add newline for git subrepo diffs
Mathias De Maré <mathias.demare@gmail.com>
parents: 23937
diff changeset
   722
  +bar
23523
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   723
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   724
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
   725
  $ 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
   726
  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
   727
  new file mode 100644
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   728
  index 0000000..8a5a5e2
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   729
  --- /dev/null
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   730
  +++ b/s/foobar
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   731
  @@ -0,0 +1,4 @@
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   732
  +woopwoop
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   733
  +
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   734
  +foo
23938
de519517f597 subrepo: correctly add newline for git subrepo diffs
Mathias De Maré <mathias.demare@gmail.com>
parents: 23937
diff changeset
   735
  +bar
23523
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   736
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   737
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
   738
  $ 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
   739
  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
   740
  --- a/.hgsubstate
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   741
  +++ b/.hgsubstate
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   742
  @@ -1,1 +1,1 @@
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   743
  -32a343883b74769118bb1d3b4b1fbf9156f4dddc s
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   744
  +fd4dbf828a5b2fcd36b2bcf21ea773820970d129 s
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   745
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   746
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
   747
  $ cd s
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   748
  $ cat > foobar << EOF
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   749
  > woop    woop
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   750
  > 
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   751
  > foo
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   752
  > bar
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   753
  > EOF
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   754
  $ echo foo > barfoo
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   755
  $ git add barfoo
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   756
  $ cd ..
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   757
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   758
  $ 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
   759
  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
   760
  new file mode 100644
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   761
  index 0000000..257cc56
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   762
  --- /dev/null
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   763
  +++ b/s/barfoo
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   764
  @@ -0,0 +1 @@
23938
de519517f597 subrepo: correctly add newline for git subrepo diffs
Mathias De Maré <mathias.demare@gmail.com>
parents: 23937
diff changeset
   765
  +foo
23523
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   766
  $ 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
   767
  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
   768
  index 8a5a5e2..bd5812a 100644
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   769
  --- a/s/foobar
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   770
  +++ b/s/foobar
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   771
  @@ -1,4 +1,4 @@
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   772
  -woopwoop
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   773
  +woop    woop
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   774
   
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   775
   foo
23938
de519517f597 subrepo: correctly add newline for git subrepo diffs
Mathias De Maré <mathias.demare@gmail.com>
parents: 23937
diff changeset
   776
   bar
23523
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   777
23542
8b5adc6b72ae tests: allow more flexibility in git diffstat output
Mathias De Maré <mathias.demare@gmail.com>
parents: 23523
diff changeset
   778
execute a diffstat
8b5adc6b72ae tests: allow more flexibility in git diffstat output
Mathias De Maré <mathias.demare@gmail.com>
parents: 23523
diff changeset
   779
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
   780
 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
   781
  $ 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
   782
  \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
   783
  \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
   784
   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
   785
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   786
ensure adding include/exclude ignores the subrepo
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   787
  $ hg diff --subrepos -I s/foobar
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   788
  $ hg diff --subrepos -X s/foobar
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   789
23550
7fa2189c1e87 subrepo: add revert support without backup for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23542
diff changeset
   790
revert the subrepository
7fa2189c1e87 subrepo: add revert support without backup for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23542
diff changeset
   791
  $ hg revert --all
23937
fd5b9417d315 tests: discard useless "(glob)" in "reverting subrepo" lines
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23693
diff changeset
   792
  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
   793
7fa2189c1e87 subrepo: add revert support without backup for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23542
diff changeset
   794
  $ hg status --subrepos
23678
194d2f185008 subrepo: add full revert support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23551
diff changeset
   795
  ? s/barfoo
194d2f185008 subrepo: add full revert support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23551
diff changeset
   796
  ? 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
   797
23678
194d2f185008 subrepo: add full revert support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23551
diff changeset
   798
  $ 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
   799
23550
7fa2189c1e87 subrepo: add revert support without backup for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23542
diff changeset
   800
  $ 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
   801
  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
   802
7fa2189c1e87 subrepo: add revert support without backup for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23542
diff changeset
   803
  $ hg status --subrepos
7fa2189c1e87 subrepo: add revert support without backup for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23542
diff changeset
   804
  ? s/barfoo
7fa2189c1e87 subrepo: add revert support without backup for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23542
diff changeset
   805
23991
07c1a7d1ef69 subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23963
diff changeset
   806
show file at specific revision
07c1a7d1ef69 subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23963
diff changeset
   807
  $ cat > s/foobar << EOF
07c1a7d1ef69 subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23963
diff changeset
   808
  > woop    woop
07c1a7d1ef69 subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23963
diff changeset
   809
  > fooo bar
07c1a7d1ef69 subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23963
diff changeset
   810
  > EOF
07c1a7d1ef69 subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23963
diff changeset
   811
  $ 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
   812
  committing subrepository s
07c1a7d1ef69 subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23963
diff changeset
   813
  $ cat > s/foobar << EOF
07c1a7d1ef69 subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23963
diff changeset
   814
  > current foobar
07c1a7d1ef69 subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23963
diff changeset
   815
  > (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
   816
  > EOF
07c1a7d1ef69 subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23963
diff changeset
   817
07c1a7d1ef69 subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23963
diff changeset
   818
  $ hg cat -r . s/foobar
07c1a7d1ef69 subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23963
diff changeset
   819
  woop    woop
07c1a7d1ef69 subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23963
diff changeset
   820
  fooo bar (no-eol)
07c1a7d1ef69 subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23963
diff changeset
   821
  $ 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
   822
07c1a7d1ef69 subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23963
diff changeset
   823
  $ mkdir -p tmp/s
07c1a7d1ef69 subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23963
diff changeset
   824
07c1a7d1ef69 subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23963
diff changeset
   825
  $ 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
   826
  $ diff tmp/% catparents
07c1a7d1ef69 subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23963
diff changeset
   827
07c1a7d1ef69 subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23963
diff changeset
   828
  $ 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
   829
  $ diff tmp/foobar catparents
07c1a7d1ef69 subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23963
diff changeset
   830
07c1a7d1ef69 subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23963
diff changeset
   831
  $ 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
   832
  $ diff tmp/s/otherfoobar catparents
07c1a7d1ef69 subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23963
diff changeset
   833
07c1a7d1ef69 subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23963
diff changeset
   834
  $ 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
   835
  $ diff tmp/s/foobar catparents
07c1a7d1ef69 subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23963
diff changeset
   836
07c1a7d1ef69 subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23963
diff changeset
   837
  $ 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
   838
  $ diff tmp/255ee8cf690ec86e99b1e80147ea93ece117cd9d catparents
07c1a7d1ef69 subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23963
diff changeset
   839
07c1a7d1ef69 subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23963
diff changeset
   840
  $ 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
   841
  $ diff tmp/10 catparents
07c1a7d1ef69 subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23963
diff changeset
   842
07c1a7d1ef69 subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23963
diff changeset
   843
  $ 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
   844
  $ diff tmp/255ee8cf690e catparents
07c1a7d1ef69 subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23963
diff changeset
   845
07c1a7d1ef69 subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23963
diff changeset
   846
  $ rm tmp/10
07c1a7d1ef69 subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23963
diff changeset
   847
  $ 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
   848
  $ diff tmp/10 catparents
07c1a7d1ef69 subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23963
diff changeset
   849
07c1a7d1ef69 subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23963
diff changeset
   850
  $ mkdir tmp/tc
07c1a7d1ef69 subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23963
diff changeset
   851
  $ 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
   852
  $ diff tmp/tc/foobar catparents
07c1a7d1ef69 subrepo: add 'cat' support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23963
diff changeset
   853
24174
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   854
cleanup
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   855
  $ rm -r tmp
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   856
  $ rm catparents
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   857
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   858
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
   859
  $ 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
   860
  $ echo "ccc" > s/c.c
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   861
  $ echo "cpp" > s/cpp.cpp
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   862
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   863
  $ 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
   864
  $ hg st --subrepos s
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   865
  M s/foobar
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   866
  A s/c.c
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   867
  A s/cpp.cpp
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   868
  A s/snake.python
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   869
  ? s/barfoo
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   870
  $ hg revert s
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   871
  reverting subrepo ../gitroot
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   872
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   873
  $ hg add --subrepos "glob:**.python"
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   874
  adding s/snake.python (glob)
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   875
  $ hg st --subrepos s
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   876
  A s/snake.python
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   877
  ? s/barfoo
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   878
  ? s/c.c
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   879
  ? s/cpp.cpp
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   880
  ? s/foobar.orig
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   881
  $ hg revert s
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   882
  reverting subrepo ../gitroot
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   883
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   884
  $ hg add --subrepos s
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   885
  adding s/barfoo (glob)
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   886
  adding s/c.c (glob)
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   887
  adding s/cpp.cpp (glob)
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   888
  adding s/foobar.orig (glob)
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   889
  adding s/snake.python (glob)
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   890
  $ hg st --subrepos s
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   891
  A s/barfoo
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   892
  A s/c.c
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   893
  A s/cpp.cpp
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   894
  A s/foobar.orig
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   895
  A s/snake.python
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   896
  $ hg revert s
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   897
  reverting subrepo ../gitroot
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   898
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
   899
  $ hg st --subrepos s
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   900
  ? s/barfoo
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   901
  ? s/c.c
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   902
  ? s/cpp.cpp
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   903
  ? s/foobar.orig
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   904
  ? s/snake.python
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   905
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   906
  $ 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
   907
  adding s/barfoo (glob)
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   908
  adding s/cpp.cpp (glob)
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   909
  adding s/foobar.orig (glob)
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   910
  adding s/snake.python (glob)
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   911
  $ hg st --subrepos s
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   912
  A s/barfoo
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   913
  A s/cpp.cpp
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   914
  A s/foobar.orig
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   915
  A s/snake.python
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   916
  ? s/c.c
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   917
  $ hg revert --all -q
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   918
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   919
.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
   920
  $ cat > .hgignore << EOF
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   921
  > syntax: glob
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   922
  > *.python
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   923
  > EOF
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   924
  $ 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
   925
  $ 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
   926
  adding s/snake.python (glob)
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   927
  $ 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
   928
  A s/barfoo
24174
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   929
  A s/snake.python
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   930
  ? s/c.c
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   931
  ? s/cpp.cpp
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   932
  ? s/foobar.orig
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   933
  $ hg revert --all -q
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   934
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   935
.gitignore should have influence,
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   936
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
   937
  $ cat > s/.gitignore << EOF
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   938
  > *.python
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   939
  > EOF
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   940
  $ hg add s/.gitignore
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   941
  $ hg st --subrepos s
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   942
  A s/.gitignore
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   943
  ? s/barfoo
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   944
  ? s/c.c
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   945
  ? s/cpp.cpp
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   946
  ? s/foobar.orig
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   947
  $ hg add --subrepos "glob:**.python"
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   948
  $ hg st --subrepos s
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   949
  A s/.gitignore
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   950
  ? s/barfoo
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   951
  ? s/c.c
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   952
  ? s/cpp.cpp
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   953
  ? s/foobar.orig
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   954
  $ 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
   955
  $ hg st --subrepos s
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   956
  A s/.gitignore
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   957
  A s/snake.python
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   958
  ? s/barfoo
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   959
  ? s/c.c
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   960
  ? s/cpp.cpp
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   961
  ? s/foobar.orig
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   962
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   963
correctly do a dry run
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   964
  $ 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
   965
  adding s/barfoo (glob)
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   966
  adding s/c.c (glob)
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   967
  adding s/cpp.cpp (glob)
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   968
  adding s/foobar.orig (glob)
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   969
  $ hg st --subrepos s
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   970
  A s/.gitignore
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   971
  A s/snake.python
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   972
  ? s/barfoo
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   973
  ? s/c.c
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   974
  ? s/cpp.cpp
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   975
  ? s/foobar.orig
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   976
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   977
currently no error given when adding an already tracked file
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   978
  $ hg add s/.gitignore
bd9f64ec891d subrepos: support adding files in git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23991
diff changeset
   979
23523
01a8dfc79cdc subrepo: add partial diff support for git subrepos
Mathias De Maré <mathias.demare@gmail.com>
parents: 23411
diff changeset
   980
  $ cd ..