tests/test-subrepo-relative-path.t
author Mads Kiilerich <mads@kiilerich.com>
Fri, 10 Dec 2010 01:30:16 +0100
branchstable
changeset 13105 2245fcd0e160
parent 12643 d08bb64888bc
child 13117 594ed85b6a3f
permissions -rw-r--r--
subrepo: initialize subrepo relative default paths relative to their root
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
11915
d521e72314f9 tests: unify test-subrepo-relative-path
Martin Geisler <mg@lazybytes.net>
parents: 11109
diff changeset
     1
Preparing the subrepository 'sub'
11109
a2bc2f2d77a9 subrepo: normalize path part of URLs so that pulling subrepos from webdir works
Edouard Gomez <ed.gomez@free.fr>
parents:
diff changeset
     2
11915
d521e72314f9 tests: unify test-subrepo-relative-path
Martin Geisler <mg@lazybytes.net>
parents: 11109
diff changeset
     3
  $ hg init sub
d521e72314f9 tests: unify test-subrepo-relative-path
Martin Geisler <mg@lazybytes.net>
parents: 11109
diff changeset
     4
  $ echo sub > sub/sub
d521e72314f9 tests: unify test-subrepo-relative-path
Martin Geisler <mg@lazybytes.net>
parents: 11109
diff changeset
     5
  $ hg add -R sub
d521e72314f9 tests: unify test-subrepo-relative-path
Martin Geisler <mg@lazybytes.net>
parents: 11109
diff changeset
     6
  adding sub/sub
d521e72314f9 tests: unify test-subrepo-relative-path
Martin Geisler <mg@lazybytes.net>
parents: 11109
diff changeset
     7
  $ hg commit -R sub -m "sub import"
d521e72314f9 tests: unify test-subrepo-relative-path
Martin Geisler <mg@lazybytes.net>
parents: 11109
diff changeset
     8
d521e72314f9 tests: unify test-subrepo-relative-path
Martin Geisler <mg@lazybytes.net>
parents: 11109
diff changeset
     9
Preparing the 'main' repo which depends on the subrepo 'sub'
11109
a2bc2f2d77a9 subrepo: normalize path part of URLs so that pulling subrepos from webdir works
Edouard Gomez <ed.gomez@free.fr>
parents:
diff changeset
    10
11915
d521e72314f9 tests: unify test-subrepo-relative-path
Martin Geisler <mg@lazybytes.net>
parents: 11109
diff changeset
    11
  $ hg init main
d521e72314f9 tests: unify test-subrepo-relative-path
Martin Geisler <mg@lazybytes.net>
parents: 11109
diff changeset
    12
  $ echo main > main/main
d521e72314f9 tests: unify test-subrepo-relative-path
Martin Geisler <mg@lazybytes.net>
parents: 11109
diff changeset
    13
  $ echo "sub = ../sub" > main/.hgsub
d521e72314f9 tests: unify test-subrepo-relative-path
Martin Geisler <mg@lazybytes.net>
parents: 11109
diff changeset
    14
  $ hg clone sub main/sub
d521e72314f9 tests: unify test-subrepo-relative-path
Martin Geisler <mg@lazybytes.net>
parents: 11109
diff changeset
    15
  updating to branch default
d521e72314f9 tests: unify test-subrepo-relative-path
Martin Geisler <mg@lazybytes.net>
parents: 11109
diff changeset
    16
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
d521e72314f9 tests: unify test-subrepo-relative-path
Martin Geisler <mg@lazybytes.net>
parents: 11109
diff changeset
    17
  $ hg add -R main
d521e72314f9 tests: unify test-subrepo-relative-path
Martin Geisler <mg@lazybytes.net>
parents: 11109
diff changeset
    18
  adding main/.hgsub
d521e72314f9 tests: unify test-subrepo-relative-path
Martin Geisler <mg@lazybytes.net>
parents: 11109
diff changeset
    19
  adding main/main
d521e72314f9 tests: unify test-subrepo-relative-path
Martin Geisler <mg@lazybytes.net>
parents: 11109
diff changeset
    20
  $ hg commit -R main -m "main import"
d521e72314f9 tests: unify test-subrepo-relative-path
Martin Geisler <mg@lazybytes.net>
parents: 11109
diff changeset
    21
  committing subrepository sub
d521e72314f9 tests: unify test-subrepo-relative-path
Martin Geisler <mg@lazybytes.net>
parents: 11109
diff changeset
    22
d521e72314f9 tests: unify test-subrepo-relative-path
Martin Geisler <mg@lazybytes.net>
parents: 11109
diff changeset
    23
Cleaning both repositories, just as a clone -U
d521e72314f9 tests: unify test-subrepo-relative-path
Martin Geisler <mg@lazybytes.net>
parents: 11109
diff changeset
    24
d521e72314f9 tests: unify test-subrepo-relative-path
Martin Geisler <mg@lazybytes.net>
parents: 11109
diff changeset
    25
  $ hg up -C -R sub null
d521e72314f9 tests: unify test-subrepo-relative-path
Martin Geisler <mg@lazybytes.net>
parents: 11109
diff changeset
    26
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
d521e72314f9 tests: unify test-subrepo-relative-path
Martin Geisler <mg@lazybytes.net>
parents: 11109
diff changeset
    27
  $ hg up -C -R main null
d521e72314f9 tests: unify test-subrepo-relative-path
Martin Geisler <mg@lazybytes.net>
parents: 11109
diff changeset
    28
  0 files updated, 0 files merged, 3 files removed, 0 files unresolved
d521e72314f9 tests: unify test-subrepo-relative-path
Martin Geisler <mg@lazybytes.net>
parents: 11109
diff changeset
    29
  $ rm -rf main/sub
d521e72314f9 tests: unify test-subrepo-relative-path
Martin Geisler <mg@lazybytes.net>
parents: 11109
diff changeset
    30
d521e72314f9 tests: unify test-subrepo-relative-path
Martin Geisler <mg@lazybytes.net>
parents: 11109
diff changeset
    31
Serving them both using hgweb
11109
a2bc2f2d77a9 subrepo: normalize path part of URLs so that pulling subrepos from webdir works
Edouard Gomez <ed.gomez@free.fr>
parents:
diff changeset
    32
11915
d521e72314f9 tests: unify test-subrepo-relative-path
Martin Geisler <mg@lazybytes.net>
parents: 11109
diff changeset
    33
  $ printf '[paths]\n/main = main\nsub = sub\n' > webdir.conf
d521e72314f9 tests: unify test-subrepo-relative-path
Martin Geisler <mg@lazybytes.net>
parents: 11109
diff changeset
    34
  $ hg serve --webdir-conf webdir.conf -a localhost -p $HGPORT \
d521e72314f9 tests: unify test-subrepo-relative-path
Martin Geisler <mg@lazybytes.net>
parents: 11109
diff changeset
    35
  >    -A /dev/null -E /dev/null --pid-file hg.pid -d
d521e72314f9 tests: unify test-subrepo-relative-path
Martin Geisler <mg@lazybytes.net>
parents: 11109
diff changeset
    36
  $ cat hg.pid >> $DAEMON_PIDS
11109
a2bc2f2d77a9 subrepo: normalize path part of URLs so that pulling subrepos from webdir works
Edouard Gomez <ed.gomez@free.fr>
parents:
diff changeset
    37
11915
d521e72314f9 tests: unify test-subrepo-relative-path
Martin Geisler <mg@lazybytes.net>
parents: 11109
diff changeset
    38
Clone main from hgweb
11109
a2bc2f2d77a9 subrepo: normalize path part of URLs so that pulling subrepos from webdir works
Edouard Gomez <ed.gomez@free.fr>
parents:
diff changeset
    39
11915
d521e72314f9 tests: unify test-subrepo-relative-path
Martin Geisler <mg@lazybytes.net>
parents: 11109
diff changeset
    40
  $ hg clone "http://localhost:$HGPORT/main" cloned
d521e72314f9 tests: unify test-subrepo-relative-path
Martin Geisler <mg@lazybytes.net>
parents: 11109
diff changeset
    41
  requesting all changes
d521e72314f9 tests: unify test-subrepo-relative-path
Martin Geisler <mg@lazybytes.net>
parents: 11109
diff changeset
    42
  adding changesets
d521e72314f9 tests: unify test-subrepo-relative-path
Martin Geisler <mg@lazybytes.net>
parents: 11109
diff changeset
    43
  adding manifests
d521e72314f9 tests: unify test-subrepo-relative-path
Martin Geisler <mg@lazybytes.net>
parents: 11109
diff changeset
    44
  adding file changes
d521e72314f9 tests: unify test-subrepo-relative-path
Martin Geisler <mg@lazybytes.net>
parents: 11109
diff changeset
    45
  added 1 changesets with 3 changes to 3 files
d521e72314f9 tests: unify test-subrepo-relative-path
Martin Geisler <mg@lazybytes.net>
parents: 11109
diff changeset
    46
  updating to branch default
12643
d08bb64888bc tests: reintroduce ":$HGPORT" in test output
Mads Kiilerich <mads@kiilerich.com>
parents: 12375
diff changeset
    47
  pulling subrepo sub from http://localhost:$HGPORT/sub
11915
d521e72314f9 tests: unify test-subrepo-relative-path
Martin Geisler <mg@lazybytes.net>
parents: 11109
diff changeset
    48
  requesting all changes
d521e72314f9 tests: unify test-subrepo-relative-path
Martin Geisler <mg@lazybytes.net>
parents: 11109
diff changeset
    49
  adding changesets
d521e72314f9 tests: unify test-subrepo-relative-path
Martin Geisler <mg@lazybytes.net>
parents: 11109
diff changeset
    50
  adding manifests
d521e72314f9 tests: unify test-subrepo-relative-path
Martin Geisler <mg@lazybytes.net>
parents: 11109
diff changeset
    51
  adding file changes
d521e72314f9 tests: unify test-subrepo-relative-path
Martin Geisler <mg@lazybytes.net>
parents: 11109
diff changeset
    52
  added 1 changesets with 1 changes to 1 files
d521e72314f9 tests: unify test-subrepo-relative-path
Martin Geisler <mg@lazybytes.net>
parents: 11109
diff changeset
    53
  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
11109
a2bc2f2d77a9 subrepo: normalize path part of URLs so that pulling subrepos from webdir works
Edouard Gomez <ed.gomez@free.fr>
parents:
diff changeset
    54
11915
d521e72314f9 tests: unify test-subrepo-relative-path
Martin Geisler <mg@lazybytes.net>
parents: 11109
diff changeset
    55
Checking cloned repo ids
d521e72314f9 tests: unify test-subrepo-relative-path
Martin Geisler <mg@lazybytes.net>
parents: 11109
diff changeset
    56
d521e72314f9 tests: unify test-subrepo-relative-path
Martin Geisler <mg@lazybytes.net>
parents: 11109
diff changeset
    57
  $ hg id -R cloned
d521e72314f9 tests: unify test-subrepo-relative-path
Martin Geisler <mg@lazybytes.net>
parents: 11109
diff changeset
    58
  fdfeeb3e979e tip
d521e72314f9 tests: unify test-subrepo-relative-path
Martin Geisler <mg@lazybytes.net>
parents: 11109
diff changeset
    59
  $ hg id -R cloned/sub
d521e72314f9 tests: unify test-subrepo-relative-path
Martin Geisler <mg@lazybytes.net>
parents: 11109
diff changeset
    60
  863c1745b441 tip
d521e72314f9 tests: unify test-subrepo-relative-path
Martin Geisler <mg@lazybytes.net>
parents: 11109
diff changeset
    61
d521e72314f9 tests: unify test-subrepo-relative-path
Martin Geisler <mg@lazybytes.net>
parents: 11109
diff changeset
    62
subrepo debug for 'main' clone
11109
a2bc2f2d77a9 subrepo: normalize path part of URLs so that pulling subrepos from webdir works
Edouard Gomez <ed.gomez@free.fr>
parents:
diff changeset
    63
11915
d521e72314f9 tests: unify test-subrepo-relative-path
Martin Geisler <mg@lazybytes.net>
parents: 11109
diff changeset
    64
  $ hg debugsub -R cloned
d521e72314f9 tests: unify test-subrepo-relative-path
Martin Geisler <mg@lazybytes.net>
parents: 11109
diff changeset
    65
  path sub
d521e72314f9 tests: unify test-subrepo-relative-path
Martin Geisler <mg@lazybytes.net>
parents: 11109
diff changeset
    66
   source   ../sub
d521e72314f9 tests: unify test-subrepo-relative-path
Martin Geisler <mg@lazybytes.net>
parents: 11109
diff changeset
    67
   revision 863c1745b441bd97a8c4a096e87793073f4fb215
11109
a2bc2f2d77a9 subrepo: normalize path part of URLs so that pulling subrepos from webdir works
Edouard Gomez <ed.gomez@free.fr>
parents:
diff changeset
    68
11915
d521e72314f9 tests: unify test-subrepo-relative-path
Martin Geisler <mg@lazybytes.net>
parents: 11109
diff changeset
    69
  $ "$TESTDIR/killdaemons.py"
13105
2245fcd0e160 subrepo: initialize subrepo relative default paths relative to their root
Mads Kiilerich <mads@kiilerich.com>
parents: 12643
diff changeset
    70
2245fcd0e160 subrepo: initialize subrepo relative default paths relative to their root
Mads Kiilerich <mads@kiilerich.com>
parents: 12643
diff changeset
    71
2245fcd0e160 subrepo: initialize subrepo relative default paths relative to their root
Mads Kiilerich <mads@kiilerich.com>
parents: 12643
diff changeset
    72
Create repo with nested relative subrepos
2245fcd0e160 subrepo: initialize subrepo relative default paths relative to their root
Mads Kiilerich <mads@kiilerich.com>
parents: 12643
diff changeset
    73
2245fcd0e160 subrepo: initialize subrepo relative default paths relative to their root
Mads Kiilerich <mads@kiilerich.com>
parents: 12643
diff changeset
    74
  $ hg init r1
2245fcd0e160 subrepo: initialize subrepo relative default paths relative to their root
Mads Kiilerich <mads@kiilerich.com>
parents: 12643
diff changeset
    75
  $ hg init r1/sub
2245fcd0e160 subrepo: initialize subrepo relative default paths relative to their root
Mads Kiilerich <mads@kiilerich.com>
parents: 12643
diff changeset
    76
  $ echo sub = sub > r1/.hgsub
2245fcd0e160 subrepo: initialize subrepo relative default paths relative to their root
Mads Kiilerich <mads@kiilerich.com>
parents: 12643
diff changeset
    77
  $ hg add --cwd r1 .hgsub
2245fcd0e160 subrepo: initialize subrepo relative default paths relative to their root
Mads Kiilerich <mads@kiilerich.com>
parents: 12643
diff changeset
    78
  $ hg init r1/sub/subsub
2245fcd0e160 subrepo: initialize subrepo relative default paths relative to their root
Mads Kiilerich <mads@kiilerich.com>
parents: 12643
diff changeset
    79
  $ echo subsub = subsub > r1/sub/.hgsub
2245fcd0e160 subrepo: initialize subrepo relative default paths relative to their root
Mads Kiilerich <mads@kiilerich.com>
parents: 12643
diff changeset
    80
  $ hg add --cwd r1/sub .hgsub
2245fcd0e160 subrepo: initialize subrepo relative default paths relative to their root
Mads Kiilerich <mads@kiilerich.com>
parents: 12643
diff changeset
    81
  $ echo c1 > r1/sub/subsub/f
2245fcd0e160 subrepo: initialize subrepo relative default paths relative to their root
Mads Kiilerich <mads@kiilerich.com>
parents: 12643
diff changeset
    82
  $ hg add --cwd r1/sub/subsub f
2245fcd0e160 subrepo: initialize subrepo relative default paths relative to their root
Mads Kiilerich <mads@kiilerich.com>
parents: 12643
diff changeset
    83
  $ hg ci --cwd r1 -m0
2245fcd0e160 subrepo: initialize subrepo relative default paths relative to their root
Mads Kiilerich <mads@kiilerich.com>
parents: 12643
diff changeset
    84
  committing subrepository sub
2245fcd0e160 subrepo: initialize subrepo relative default paths relative to their root
Mads Kiilerich <mads@kiilerich.com>
parents: 12643
diff changeset
    85
  committing subrepository sub/subsub
2245fcd0e160 subrepo: initialize subrepo relative default paths relative to their root
Mads Kiilerich <mads@kiilerich.com>
parents: 12643
diff changeset
    86
2245fcd0e160 subrepo: initialize subrepo relative default paths relative to their root
Mads Kiilerich <mads@kiilerich.com>
parents: 12643
diff changeset
    87
Ensure correct relative paths are used when pulling
2245fcd0e160 subrepo: initialize subrepo relative default paths relative to their root
Mads Kiilerich <mads@kiilerich.com>
parents: 12643
diff changeset
    88
2245fcd0e160 subrepo: initialize subrepo relative default paths relative to their root
Mads Kiilerich <mads@kiilerich.com>
parents: 12643
diff changeset
    89
  $ hg init r2
2245fcd0e160 subrepo: initialize subrepo relative default paths relative to their root
Mads Kiilerich <mads@kiilerich.com>
parents: 12643
diff changeset
    90
  $ cd r2/
2245fcd0e160 subrepo: initialize subrepo relative default paths relative to their root
Mads Kiilerich <mads@kiilerich.com>
parents: 12643
diff changeset
    91
  $ hg pull -u ../r1
2245fcd0e160 subrepo: initialize subrepo relative default paths relative to their root
Mads Kiilerich <mads@kiilerich.com>
parents: 12643
diff changeset
    92
  pulling from ../r1
2245fcd0e160 subrepo: initialize subrepo relative default paths relative to their root
Mads Kiilerich <mads@kiilerich.com>
parents: 12643
diff changeset
    93
  requesting all changes
2245fcd0e160 subrepo: initialize subrepo relative default paths relative to their root
Mads Kiilerich <mads@kiilerich.com>
parents: 12643
diff changeset
    94
  adding changesets
2245fcd0e160 subrepo: initialize subrepo relative default paths relative to their root
Mads Kiilerich <mads@kiilerich.com>
parents: 12643
diff changeset
    95
  adding manifests
2245fcd0e160 subrepo: initialize subrepo relative default paths relative to their root
Mads Kiilerich <mads@kiilerich.com>
parents: 12643
diff changeset
    96
  adding file changes
2245fcd0e160 subrepo: initialize subrepo relative default paths relative to their root
Mads Kiilerich <mads@kiilerich.com>
parents: 12643
diff changeset
    97
  added 1 changesets with 2 changes to 2 files
2245fcd0e160 subrepo: initialize subrepo relative default paths relative to their root
Mads Kiilerich <mads@kiilerich.com>
parents: 12643
diff changeset
    98
  pulling subrepo sub from ../r1/sub
2245fcd0e160 subrepo: initialize subrepo relative default paths relative to their root
Mads Kiilerich <mads@kiilerich.com>
parents: 12643
diff changeset
    99
  requesting all changes
2245fcd0e160 subrepo: initialize subrepo relative default paths relative to their root
Mads Kiilerich <mads@kiilerich.com>
parents: 12643
diff changeset
   100
  adding changesets
2245fcd0e160 subrepo: initialize subrepo relative default paths relative to their root
Mads Kiilerich <mads@kiilerich.com>
parents: 12643
diff changeset
   101
  adding manifests
2245fcd0e160 subrepo: initialize subrepo relative default paths relative to their root
Mads Kiilerich <mads@kiilerich.com>
parents: 12643
diff changeset
   102
  adding file changes
2245fcd0e160 subrepo: initialize subrepo relative default paths relative to their root
Mads Kiilerich <mads@kiilerich.com>
parents: 12643
diff changeset
   103
  added 1 changesets with 2 changes to 2 files
2245fcd0e160 subrepo: initialize subrepo relative default paths relative to their root
Mads Kiilerich <mads@kiilerich.com>
parents: 12643
diff changeset
   104
  pulling subrepo sub/subsub from ../r1/sub/subsub
2245fcd0e160 subrepo: initialize subrepo relative default paths relative to their root
Mads Kiilerich <mads@kiilerich.com>
parents: 12643
diff changeset
   105
  requesting all changes
2245fcd0e160 subrepo: initialize subrepo relative default paths relative to their root
Mads Kiilerich <mads@kiilerich.com>
parents: 12643
diff changeset
   106
  adding changesets
2245fcd0e160 subrepo: initialize subrepo relative default paths relative to their root
Mads Kiilerich <mads@kiilerich.com>
parents: 12643
diff changeset
   107
  adding manifests
2245fcd0e160 subrepo: initialize subrepo relative default paths relative to their root
Mads Kiilerich <mads@kiilerich.com>
parents: 12643
diff changeset
   108
  adding file changes
2245fcd0e160 subrepo: initialize subrepo relative default paths relative to their root
Mads Kiilerich <mads@kiilerich.com>
parents: 12643
diff changeset
   109
  added 1 changesets with 1 changes to 1 files
2245fcd0e160 subrepo: initialize subrepo relative default paths relative to their root
Mads Kiilerich <mads@kiilerich.com>
parents: 12643
diff changeset
   110
  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
2245fcd0e160 subrepo: initialize subrepo relative default paths relative to their root
Mads Kiilerich <mads@kiilerich.com>
parents: 12643
diff changeset
   111
  $ cd ..
2245fcd0e160 subrepo: initialize subrepo relative default paths relative to their root
Mads Kiilerich <mads@kiilerich.com>
parents: 12643
diff changeset
   112
2245fcd0e160 subrepo: initialize subrepo relative default paths relative to their root
Mads Kiilerich <mads@kiilerich.com>
parents: 12643
diff changeset
   113
Verify subrepo default paths were set correctly
2245fcd0e160 subrepo: initialize subrepo relative default paths relative to their root
Mads Kiilerich <mads@kiilerich.com>
parents: 12643
diff changeset
   114
2245fcd0e160 subrepo: initialize subrepo relative default paths relative to their root
Mads Kiilerich <mads@kiilerich.com>
parents: 12643
diff changeset
   115
  $ hg -R r2/sub paths
2245fcd0e160 subrepo: initialize subrepo relative default paths relative to their root
Mads Kiilerich <mads@kiilerich.com>
parents: 12643
diff changeset
   116
  default = $TESTTMP/r1/sub
2245fcd0e160 subrepo: initialize subrepo relative default paths relative to their root
Mads Kiilerich <mads@kiilerich.com>
parents: 12643
diff changeset
   117
  $ cat r2/sub/.hg/hgrc
2245fcd0e160 subrepo: initialize subrepo relative default paths relative to their root
Mads Kiilerich <mads@kiilerich.com>
parents: 12643
diff changeset
   118
  [paths]
2245fcd0e160 subrepo: initialize subrepo relative default paths relative to their root
Mads Kiilerich <mads@kiilerich.com>
parents: 12643
diff changeset
   119
  default = ../../r1/sub
2245fcd0e160 subrepo: initialize subrepo relative default paths relative to their root
Mads Kiilerich <mads@kiilerich.com>
parents: 12643
diff changeset
   120
  $ hg -R r2/sub/subsub paths
2245fcd0e160 subrepo: initialize subrepo relative default paths relative to their root
Mads Kiilerich <mads@kiilerich.com>
parents: 12643
diff changeset
   121
  default = $TESTTMP/r1/sub/subsub
2245fcd0e160 subrepo: initialize subrepo relative default paths relative to their root
Mads Kiilerich <mads@kiilerich.com>
parents: 12643
diff changeset
   122
  $ cat r2/sub/subsub/.hg/hgrc
2245fcd0e160 subrepo: initialize subrepo relative default paths relative to their root
Mads Kiilerich <mads@kiilerich.com>
parents: 12643
diff changeset
   123
  [paths]
2245fcd0e160 subrepo: initialize subrepo relative default paths relative to their root
Mads Kiilerich <mads@kiilerich.com>
parents: 12643
diff changeset
   124
  default = ../../../r1/sub/subsub