tests/test-manifest.t
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
Sat, 24 Dec 2011 19:05:35 +0900
branchstable
changeset 15723 1581da01d5c4
parent 14399 71938479eff9
child 15441 e0348815e806
permissions -rw-r--r--
windows: use normalized path as path to subrepo path to subrepo is used to identify or check location of subrepo. it should be normalized (in "/" delimiter form), because it is also used with narrowmatcher which uses only normalized path even on Windows environment. this patch applies "util.pconvert()" on path to subrepo (called "subpath") to normalize it. for this patch, referers of below were checked. - subrepo.state() - subrepo.itersubrepos() - subrepo.subrepo() - context.sub() - context.substate() typical usecase is: for subpath in ctx.substate: sub = ctx.sub(subpath) ... ctx.substate[subpath] .... in this case, normalization has no side effect, because keys given from substate are used as key itself. other cases shown below also seem to require subpath to be normalized. - path components are joined by "/", in "commands.forget()": for subpath in ctx.substate: subforget[subpath + '/' + fsub] = (fsub, sub) - normalized "file" is used to check below condition, in "commands.revert()", "localrepository.commit()", and "localrepository._checknested()" file in ctx.substate - substate.keys() is passed to dirstate.walk()/status() which use only normalized pathes
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
Source bundle was generated with the following script:
b63f6422d2a7 tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents: 12316
diff changeset
     2
5406
f11554a097c8 test-manifest: test symlink and exec bit display
Patrick Mezard <pmezard@gmail.com>
parents: 5155
diff changeset
     3
# hg init
f11554a097c8 test-manifest: test symlink and exec bit display
Patrick Mezard <pmezard@gmail.com>
parents: 5155
diff changeset
     4
# echo a > a
f11554a097c8 test-manifest: test symlink and exec bit display
Patrick Mezard <pmezard@gmail.com>
parents: 5155
diff changeset
     5
# ln -s a l
f11554a097c8 test-manifest: test symlink and exec bit display
Patrick Mezard <pmezard@gmail.com>
parents: 5155
diff changeset
     6
# hg ci -Ama -d'0 0'
f11554a097c8 test-manifest: test symlink and exec bit display
Patrick Mezard <pmezard@gmail.com>
parents: 5155
diff changeset
     7
# mkdir b
f11554a097c8 test-manifest: test symlink and exec bit display
Patrick Mezard <pmezard@gmail.com>
parents: 5155
diff changeset
     8
# echo a > b/a
f11554a097c8 test-manifest: test symlink and exec bit display
Patrick Mezard <pmezard@gmail.com>
parents: 5155
diff changeset
     9
# chmod +x b/a
f11554a097c8 test-manifest: test symlink and exec bit display
Patrick Mezard <pmezard@gmail.com>
parents: 5155
diff changeset
    10
# hg ci -Amb -d'1 0'
f11554a097c8 test-manifest: test symlink and exec bit display
Patrick Mezard <pmezard@gmail.com>
parents: 5155
diff changeset
    11
12253
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
    12
  $ hg init
14116
cd3032437064 tests: move test bundles in a bundles/ subdirectory
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12346
diff changeset
    13
  $ hg -q pull "$TESTDIR/bundles/test-manifest.hg"
12253
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
    14
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
    15
The next call is expected to return nothing:
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
    16
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
    17
  $ hg manifest
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
    18
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
    19
  $ hg co
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
    20
  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
5406
f11554a097c8 test-manifest: test symlink and exec bit display
Patrick Mezard <pmezard@gmail.com>
parents: 5155
diff changeset
    21
12253
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
    22
  $ hg manifest
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
    23
  a
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
    24
  b/a
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
    25
  l
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
    26
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
    27
  $ hg manifest -v
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
    28
  644   a
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
    29
  755 * b/a
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
    30
  644 @ l
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
    31
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
    32
  $ hg manifest --debug
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
    33
  b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 644   a
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
    34
  b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 755 * b/a
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
    35
  047b75c6d7a3ef6a2243bd0e99f94f6ea6683597 644 @ l
6737
7239e06e58e9 context: consistently return p1 context for None
Matt Mackall <mpm@selenic.com>
parents: 5406
diff changeset
    36
12253
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
    37
  $ hg manifest -r 0
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
    38
  a
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
    39
  l
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
    40
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
    41
  $ hg manifest -r 1
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
    42
  a
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
    43
  b/a
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
    44
  l
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
    45
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
    46
  $ hg manifest -r tip
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
    47
  a
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
    48
  b/a
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
    49
  l
5155
13d23d66a6cd manifest: accept -r for rev specification
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    50
12253
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
    51
  $ hg manifest tip
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
    52
  a
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
    53
  b/a
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
    54
  l
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
    55
14399
71938479eff9 add new option --all to manifest command
Adrian Buehlmann <adrian@cadifra.com>
parents: 14116
diff changeset
    56
  $ hg manifest --all
71938479eff9 add new option --all to manifest command
Adrian Buehlmann <adrian@cadifra.com>
parents: 14116
diff changeset
    57
  a
71938479eff9 add new option --all to manifest command
Adrian Buehlmann <adrian@cadifra.com>
parents: 14116
diff changeset
    58
  b/a
71938479eff9 add new option --all to manifest command
Adrian Buehlmann <adrian@cadifra.com>
parents: 14116
diff changeset
    59
  l
12253
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
    60
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
    61
The next two calls are expected to abort:
5155
13d23d66a6cd manifest: accept -r for rev specification
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    62
12253
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
    63
  $ hg manifest -r 2
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
    64
  abort: unknown revision '2'!
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12253
diff changeset
    65
  [255]
12253
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
    66
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
    67
  $ hg manifest -r tip tip
e5aee120287b tests: unify test-manifest*
Adrian Buehlmann <adrian@cadifra.com>
parents: 6737
diff changeset
    68
  abort: please specify just one revision
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12253
diff changeset
    69
  [255]