tests/test-init.t
author Adrian Buehlmann <adrian@cadifra.com>
Mon, 11 Jun 2012 13:41:02 +0200
changeset 16915 ccebe526d321
parent 16541 bb3334806ace
child 16974 01ed5bb5cd41
permissions -rw-r--r--
test-init: enable for Windows On Windows, we can't create a directory with the name " ", as that is not a valid name for a directory.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12328
b63f6422d2a7 tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents: 12316
diff changeset
     1
This test tries to exercise the ssh functionality with a dummy script
2599
e4b5e48052c6 Added tests for local and remote init.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
     2
11786
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
     3
  $ checknewrepo()
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
     4
  > {
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
     5
  >    name=$1
12584
fb24b491e06a init: expand destination url as a configured paths
Mads Kiilerich <mads@kiilerich.com>
parents: 12328
diff changeset
     6
  >    if [ -d "$name"/.hg/store ]; then
11786
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
     7
  >    echo store created
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
     8
  >    fi
12584
fb24b491e06a init: expand destination url as a configured paths
Mads Kiilerich <mads@kiilerich.com>
parents: 12328
diff changeset
     9
  >    if [ -f "$name"/.hg/00changelog.i ]; then
11786
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
    10
  >    echo 00changelog.i created
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
    11
  >    fi
12584
fb24b491e06a init: expand destination url as a configured paths
Mads Kiilerich <mads@kiilerich.com>
parents: 12328
diff changeset
    12
  >    cat "$name"/.hg/requires
11786
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
    13
  > }
2599
e4b5e48052c6 Added tests for local and remote init.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
    14
11786
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
    15
creating 'local'
4166
c0271aba6abe small fixes for the parent patch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3713
diff changeset
    16
11786
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
    17
  $ hg init local
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
    18
  $ checknewrepo local
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
    19
  store created
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
    20
  00changelog.i created
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
    21
  revlogv1
14905
207935cda6dc localrepo: make requirements attribute of newly-created repos contain a set
Andrew Pritchard <andrewp@fogcreek.com>
parents: 14186
diff changeset
    22
  fncache
11786
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
    23
  store
12687
34d8247a4595 store: encode first period or space in filenames (issue1713)
Adrian Buehlmann <adrian@cadifra.com>
parents: 12584
diff changeset
    24
  dotencode
11786
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
    25
  $ echo this > local/foo
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 11883
diff changeset
    26
  $ hg ci --cwd local -A -m "init"
11786
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
    27
  adding foo
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
    28
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
    29
creating repo with format.usestore=false
4166
c0271aba6abe small fixes for the parent patch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3713
diff changeset
    30
11786
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
    31
  $ hg --config format.usestore=false init old
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
    32
  $ checknewrepo old
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
    33
  revlogv1
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
    34
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
    35
creating repo with format.usefncache=false
4166
c0271aba6abe small fixes for the parent patch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3713
diff changeset
    36
11786
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
    37
  $ hg --config format.usefncache=false init old2
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
    38
  $ checknewrepo old2
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
    39
  store created
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
    40
  00changelog.i created
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
    41
  revlogv1
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
    42
  store
4166
c0271aba6abe small fixes for the parent patch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3713
diff changeset
    43
12712
1b546140b85e tests: add testcase for --config format.dotencode=false
Adrian Buehlmann <adrian@cadifra.com>
parents: 12687
diff changeset
    44
creating repo with format.dotencode=false
1b546140b85e tests: add testcase for --config format.dotencode=false
Adrian Buehlmann <adrian@cadifra.com>
parents: 12687
diff changeset
    45
1b546140b85e tests: add testcase for --config format.dotencode=false
Adrian Buehlmann <adrian@cadifra.com>
parents: 12687
diff changeset
    46
  $ hg --config format.dotencode=false init old3
1b546140b85e tests: add testcase for --config format.dotencode=false
Adrian Buehlmann <adrian@cadifra.com>
parents: 12687
diff changeset
    47
  $ checknewrepo old3
1b546140b85e tests: add testcase for --config format.dotencode=false
Adrian Buehlmann <adrian@cadifra.com>
parents: 12687
diff changeset
    48
  store created
1b546140b85e tests: add testcase for --config format.dotencode=false
Adrian Buehlmann <adrian@cadifra.com>
parents: 12687
diff changeset
    49
  00changelog.i created
1b546140b85e tests: add testcase for --config format.dotencode=false
Adrian Buehlmann <adrian@cadifra.com>
parents: 12687
diff changeset
    50
  revlogv1
14905
207935cda6dc localrepo: make requirements attribute of newly-created repos contain a set
Andrew Pritchard <andrewp@fogcreek.com>
parents: 14186
diff changeset
    51
  fncache
12712
1b546140b85e tests: add testcase for --config format.dotencode=false
Adrian Buehlmann <adrian@cadifra.com>
parents: 12687
diff changeset
    52
  store
1b546140b85e tests: add testcase for --config format.dotencode=false
Adrian Buehlmann <adrian@cadifra.com>
parents: 12687
diff changeset
    53
11786
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
    54
test failure
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
    55
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
    56
  $ hg init local
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
    57
  abort: repository local already exists!
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    58
  [255]
11786
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
    59
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
    60
init+push to remote2
2599
e4b5e48052c6 Added tests for local and remote init.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
    61
16541
bb3334806ace tests: quote dummyssh in a way that works on windows too
Mads Kiilerich <mads@kiilerich.com>
parents: 16350
diff changeset
    62
  $ hg init -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote2
11786
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
    63
  $ hg incoming -R remote2 local
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
    64
  comparing with local
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 11883
diff changeset
    65
  changeset:   0:08b9e9f63b32
11786
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
    66
  tag:         tip
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
    67
  user:        test
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 11883
diff changeset
    68
  date:        Thu Jan 01 00:00:00 1970 +0000
11786
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
    69
  summary:     init
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
    70
  
4166
c0271aba6abe small fixes for the parent patch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3713
diff changeset
    71
16541
bb3334806ace tests: quote dummyssh in a way that works on windows too
Mads Kiilerich <mads@kiilerich.com>
parents: 16350
diff changeset
    72
  $ hg push -R local -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote2
11786
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
    73
  pushing to ssh://user@dummy/remote2
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
    74
  searching for changes
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
    75
  remote: adding changesets
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
    76
  remote: adding manifests
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
    77
  remote: adding file changes
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
    78
  remote: added 1 changesets with 1 changes to 1 files
7249
671b3e1eac2e test-init: add test with format.usefncache=false
Adrian Buehlmann <adrian@cadifra.com>
parents: 4297
diff changeset
    79
11786
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
    80
clone to remote1
3037
3acb76f0124d clone: simplifying dest repo creation
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 2599
diff changeset
    81
16541
bb3334806ace tests: quote dummyssh in a way that works on windows too
Mads Kiilerich <mads@kiilerich.com>
parents: 16350
diff changeset
    82
  $ hg clone -e "python \"$TESTDIR/dummyssh\"" local ssh://user@dummy/remote1
11786
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
    83
  searching for changes
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
    84
  remote: adding changesets
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
    85
  remote: adding manifests
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
    86
  remote: adding file changes
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
    87
  remote: added 1 changesets with 1 changes to 1 files
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
    88
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
    89
init to existing repo
2599
e4b5e48052c6 Added tests for local and remote init.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
    90
16541
bb3334806ace tests: quote dummyssh in a way that works on windows too
Mads Kiilerich <mads@kiilerich.com>
parents: 16350
diff changeset
    91
  $ hg init -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote1
11786
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
    92
  abort: repository remote1 already exists!
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
    93
  abort: could not create remote repo!
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    94
  [255]
11786
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
    95
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
    96
clone to existing repo
2599
e4b5e48052c6 Added tests for local and remote init.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
    97
16541
bb3334806ace tests: quote dummyssh in a way that works on windows too
Mads Kiilerich <mads@kiilerich.com>
parents: 16350
diff changeset
    98
  $ hg clone -e "python \"$TESTDIR/dummyssh\"" local ssh://user@dummy/remote1
11786
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
    99
  abort: repository remote1 already exists!
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
   100
  abort: could not create remote repo!
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   101
  [255]
11786
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
   102
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
   103
output of dummyssh
3037
3acb76f0124d clone: simplifying dest repo creation
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 2599
diff changeset
   104
11786
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
   105
  $ cat dummylog
15622
86fc364ca5f8 sshrepo: don't quote obviously safe strings (issue2983)
Mads Kiilerich <mads@kiilerich.com>
parents: 15581
diff changeset
   106
  Got arguments 1:user@dummy 2:hg init remote2
86fc364ca5f8 sshrepo: don't quote obviously safe strings (issue2983)
Mads Kiilerich <mads@kiilerich.com>
parents: 15581
diff changeset
   107
  Got arguments 1:user@dummy 2:hg -R remote2 serve --stdio
86fc364ca5f8 sshrepo: don't quote obviously safe strings (issue2983)
Mads Kiilerich <mads@kiilerich.com>
parents: 15581
diff changeset
   108
  Got arguments 1:user@dummy 2:hg -R remote2 serve --stdio
86fc364ca5f8 sshrepo: don't quote obviously safe strings (issue2983)
Mads Kiilerich <mads@kiilerich.com>
parents: 15581
diff changeset
   109
  Got arguments 1:user@dummy 2:hg init remote1
86fc364ca5f8 sshrepo: don't quote obviously safe strings (issue2983)
Mads Kiilerich <mads@kiilerich.com>
parents: 15581
diff changeset
   110
  Got arguments 1:user@dummy 2:hg -R remote1 serve --stdio
86fc364ca5f8 sshrepo: don't quote obviously safe strings (issue2983)
Mads Kiilerich <mads@kiilerich.com>
parents: 15581
diff changeset
   111
  Got arguments 1:user@dummy 2:hg init remote1
86fc364ca5f8 sshrepo: don't quote obviously safe strings (issue2983)
Mads Kiilerich <mads@kiilerich.com>
parents: 15581
diff changeset
   112
  Got arguments 1:user@dummy 2:hg init remote1
3037
3acb76f0124d clone: simplifying dest repo creation
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 2599
diff changeset
   113
11786
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
   114
comparing repositories
2599
e4b5e48052c6 Added tests for local and remote init.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
   115
11786
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
   116
  $ hg tip -q -R local
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 11883
diff changeset
   117
  0:08b9e9f63b32
11786
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
   118
  $ hg tip -q -R remote1
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 11883
diff changeset
   119
  0:08b9e9f63b32
11786
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
   120
  $ hg tip -q -R remote2
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 11883
diff changeset
   121
  0:08b9e9f63b32
11786
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
   122
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
   123
check names for repositories (clashes with URL schemes, special chars)
2599
e4b5e48052c6 Added tests for local and remote init.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
   124
16915
ccebe526d321 test-init: enable for Windows
Adrian Buehlmann <adrian@cadifra.com>
parents: 16541
diff changeset
   125
  $ for i in bundle file hg http https old-http ssh static-http "with space"; do
11883
01e04df696e3 test-init: replace 'echo -n' with 'printf'
Martin Geisler <mg@lazybytes.net>
parents: 11786
diff changeset
   126
  >   printf "hg init \"$i\"... "
11786
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
   127
  >   hg init "$i"
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
   128
  >   test -d "$i" -a -d "$i/.hg" && echo "ok" || echo "failed"
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
   129
  > done
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
   130
  hg init "bundle"... ok
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
   131
  hg init "file"... ok
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
   132
  hg init "hg"... ok
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
   133
  hg init "http"... ok
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
   134
  hg init "https"... ok
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
   135
  hg init "old-http"... ok
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
   136
  hg init "ssh"... ok
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
   137
  hg init "static-http"... ok
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
   138
  hg init "with space"... ok
16915
ccebe526d321 test-init: enable for Windows
Adrian Buehlmann <adrian@cadifra.com>
parents: 16541
diff changeset
   139
#if no-windows
ccebe526d321 test-init: enable for Windows
Adrian Buehlmann <adrian@cadifra.com>
parents: 16541
diff changeset
   140
/* " " is not a valid name for a directory on Windows */
ccebe526d321 test-init: enable for Windows
Adrian Buehlmann <adrian@cadifra.com>
parents: 16541
diff changeset
   141
  $ hg init " "
ccebe526d321 test-init: enable for Windows
Adrian Buehlmann <adrian@cadifra.com>
parents: 16541
diff changeset
   142
  $ test -d " "
ccebe526d321 test-init: enable for Windows
Adrian Buehlmann <adrian@cadifra.com>
parents: 16541
diff changeset
   143
  $ test -d " /.hg"
ccebe526d321 test-init: enable for Windows
Adrian Buehlmann <adrian@cadifra.com>
parents: 16541
diff changeset
   144
#endif
2599
e4b5e48052c6 Added tests for local and remote init.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
   145
11786
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
   146
creating 'local/sub/repo'
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
   147
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
   148
  $ hg init local/sub/repo
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
   149
  $ checknewrepo local/sub/repo
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
   150
  store created
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
   151
  00changelog.i created
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
   152
  revlogv1
14905
207935cda6dc localrepo: make requirements attribute of newly-created repos contain a set
Andrew Pritchard <andrewp@fogcreek.com>
parents: 14186
diff changeset
   153
  fncache
11786
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
   154
  store
12687
34d8247a4595 store: encode first period or space in filenames (issue1713)
Adrian Buehlmann <adrian@cadifra.com>
parents: 12584
diff changeset
   155
  dotencode
12584
fb24b491e06a init: expand destination url as a configured paths
Mads Kiilerich <mads@kiilerich.com>
parents: 12328
diff changeset
   156
fb24b491e06a init: expand destination url as a configured paths
Mads Kiilerich <mads@kiilerich.com>
parents: 12328
diff changeset
   157
prepare test of init of url configured from paths
fb24b491e06a init: expand destination url as a configured paths
Mads Kiilerich <mads@kiilerich.com>
parents: 12328
diff changeset
   158
fb24b491e06a init: expand destination url as a configured paths
Mads Kiilerich <mads@kiilerich.com>
parents: 12328
diff changeset
   159
  $ echo '[paths]' >> $HGRCPATH
fb24b491e06a init: expand destination url as a configured paths
Mads Kiilerich <mads@kiilerich.com>
parents: 12328
diff changeset
   160
  $ echo "somewhere = `pwd`/url from paths" >> $HGRCPATH
fb24b491e06a init: expand destination url as a configured paths
Mads Kiilerich <mads@kiilerich.com>
parents: 12328
diff changeset
   161
  $ echo "elsewhere = `pwd`/another paths url" >> $HGRCPATH
fb24b491e06a init: expand destination url as a configured paths
Mads Kiilerich <mads@kiilerich.com>
parents: 12328
diff changeset
   162
fb24b491e06a init: expand destination url as a configured paths
Mads Kiilerich <mads@kiilerich.com>
parents: 12328
diff changeset
   163
init should (for consistency with clone) expand the url
fb24b491e06a init: expand destination url as a configured paths
Mads Kiilerich <mads@kiilerich.com>
parents: 12328
diff changeset
   164
fb24b491e06a init: expand destination url as a configured paths
Mads Kiilerich <mads@kiilerich.com>
parents: 12328
diff changeset
   165
  $ hg init somewhere
fb24b491e06a init: expand destination url as a configured paths
Mads Kiilerich <mads@kiilerich.com>
parents: 12328
diff changeset
   166
  $ checknewrepo "url from paths"
fb24b491e06a init: expand destination url as a configured paths
Mads Kiilerich <mads@kiilerich.com>
parents: 12328
diff changeset
   167
  store created
fb24b491e06a init: expand destination url as a configured paths
Mads Kiilerich <mads@kiilerich.com>
parents: 12328
diff changeset
   168
  00changelog.i created
fb24b491e06a init: expand destination url as a configured paths
Mads Kiilerich <mads@kiilerich.com>
parents: 12328
diff changeset
   169
  revlogv1
14905
207935cda6dc localrepo: make requirements attribute of newly-created repos contain a set
Andrew Pritchard <andrewp@fogcreek.com>
parents: 14186
diff changeset
   170
  fncache
12584
fb24b491e06a init: expand destination url as a configured paths
Mads Kiilerich <mads@kiilerich.com>
parents: 12328
diff changeset
   171
  store
12687
34d8247a4595 store: encode first period or space in filenames (issue1713)
Adrian Buehlmann <adrian@cadifra.com>
parents: 12584
diff changeset
   172
  dotencode
12584
fb24b491e06a init: expand destination url as a configured paths
Mads Kiilerich <mads@kiilerich.com>
parents: 12328
diff changeset
   173
fb24b491e06a init: expand destination url as a configured paths
Mads Kiilerich <mads@kiilerich.com>
parents: 12328
diff changeset
   174
verify that clone also expand urls
fb24b491e06a init: expand destination url as a configured paths
Mads Kiilerich <mads@kiilerich.com>
parents: 12328
diff changeset
   175
fb24b491e06a init: expand destination url as a configured paths
Mads Kiilerich <mads@kiilerich.com>
parents: 12328
diff changeset
   176
  $ hg clone somewhere elsewhere
fb24b491e06a init: expand destination url as a configured paths
Mads Kiilerich <mads@kiilerich.com>
parents: 12328
diff changeset
   177
  updating to branch default
fb24b491e06a init: expand destination url as a configured paths
Mads Kiilerich <mads@kiilerich.com>
parents: 12328
diff changeset
   178
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
fb24b491e06a init: expand destination url as a configured paths
Mads Kiilerich <mads@kiilerich.com>
parents: 12328
diff changeset
   179
  $ checknewrepo "another paths url"
fb24b491e06a init: expand destination url as a configured paths
Mads Kiilerich <mads@kiilerich.com>
parents: 12328
diff changeset
   180
  store created
fb24b491e06a init: expand destination url as a configured paths
Mads Kiilerich <mads@kiilerich.com>
parents: 12328
diff changeset
   181
  00changelog.i created
fb24b491e06a init: expand destination url as a configured paths
Mads Kiilerich <mads@kiilerich.com>
parents: 12328
diff changeset
   182
  revlogv1
14905
207935cda6dc localrepo: make requirements attribute of newly-created repos contain a set
Andrew Pritchard <andrewp@fogcreek.com>
parents: 14186
diff changeset
   183
  fncache
12584
fb24b491e06a init: expand destination url as a configured paths
Mads Kiilerich <mads@kiilerich.com>
parents: 12328
diff changeset
   184
  store
12687
34d8247a4595 store: encode first period or space in filenames (issue1713)
Adrian Buehlmann <adrian@cadifra.com>
parents: 12584
diff changeset
   185
  dotencode
13604
3f6a4579f803 hg: add support for cloning bookmarks
David Soria Parra <dsp@php.net>
parents: 12712
diff changeset
   186
3f6a4579f803 hg: add support for cloning bookmarks
David Soria Parra <dsp@php.net>
parents: 12712
diff changeset
   187
clone bookmarks
3f6a4579f803 hg: add support for cloning bookmarks
David Soria Parra <dsp@php.net>
parents: 12712
diff changeset
   188
3f6a4579f803 hg: add support for cloning bookmarks
David Soria Parra <dsp@php.net>
parents: 12712
diff changeset
   189
  $ hg -R local bookmark test
3f6a4579f803 hg: add support for cloning bookmarks
David Soria Parra <dsp@php.net>
parents: 12712
diff changeset
   190
  $ hg -R local bookmarks
3f6a4579f803 hg: add support for cloning bookmarks
David Soria Parra <dsp@php.net>
parents: 12712
diff changeset
   191
   * test                      0:08b9e9f63b32
16541
bb3334806ace tests: quote dummyssh in a way that works on windows too
Mads Kiilerich <mads@kiilerich.com>
parents: 16350
diff changeset
   192
  $ hg clone -e "python \"$TESTDIR/dummyssh\"" local ssh://user@dummy/remote-bookmarks
13604
3f6a4579f803 hg: add support for cloning bookmarks
David Soria Parra <dsp@php.net>
parents: 12712
diff changeset
   193
  searching for changes
3f6a4579f803 hg: add support for cloning bookmarks
David Soria Parra <dsp@php.net>
parents: 12712
diff changeset
   194
  remote: adding changesets
3f6a4579f803 hg: add support for cloning bookmarks
David Soria Parra <dsp@php.net>
parents: 12712
diff changeset
   195
  remote: adding manifests
3f6a4579f803 hg: add support for cloning bookmarks
David Soria Parra <dsp@php.net>
parents: 12712
diff changeset
   196
  remote: adding file changes
3f6a4579f803 hg: add support for cloning bookmarks
David Soria Parra <dsp@php.net>
parents: 12712
diff changeset
   197
  remote: added 1 changesets with 1 changes to 1 files
3f6a4579f803 hg: add support for cloning bookmarks
David Soria Parra <dsp@php.net>
parents: 12712
diff changeset
   198
  $ hg -R remote-bookmarks bookmarks
3f6a4579f803 hg: add support for cloning bookmarks
David Soria Parra <dsp@php.net>
parents: 12712
diff changeset
   199
     test                      0:08b9e9f63b32