tests/test-rebuildstate.t
author Mads Kiilerich <madski@unity3d.com>
Fri, 09 Jan 2015 18:38:02 +0100
changeset 23840 ddc17eaf0f1b
parent 16913 f2719b387380
child 27174 9fbe3545e4bd
permissions -rw-r--r--
debugdirstate: don't hide date field with --nodate, just show 'set'/'unset' The value of the dirstate date field cannot be used in tests and we thus have to use debugdirstate with --nodate. It is however still very helpful to be able to see whether the date field has been set or still is unset. The absence of that information made it hard to debug some largefile dirstate issues. This change _could_ make the test suite more unstable ... but that would be places where the test suite or the code should be made more stable. (Note: 'unset' with the magic negative sizes is reliable. 'unset' for normal sizes would probably not be reliable, but there is no such occurrences in the test suite and it should thus be reliable.) This output wastes more horizontal space in the --nodate output, but it also makes things simpler that the output format always is the same. It is just a debug command so let's keep it simple.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12121
8f258dd4ed02 tests: unify test-rebuildstate
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6344
diff changeset
     1
basic test for hg debugrebuildstate
8f258dd4ed02 tests: unify test-rebuildstate
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6344
diff changeset
     2
8f258dd4ed02 tests: unify test-rebuildstate
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6344
diff changeset
     3
  $ hg init repo
8f258dd4ed02 tests: unify test-rebuildstate
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6344
diff changeset
     4
  $ cd repo
5065
b304c2496f52 dirstate: fix rebuild; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
     5
12121
8f258dd4ed02 tests: unify test-rebuildstate
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6344
diff changeset
     6
  $ touch foo bar
8f258dd4ed02 tests: unify test-rebuildstate
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6344
diff changeset
     7
  $ hg ci -Am 'add foo bar'
8f258dd4ed02 tests: unify test-rebuildstate
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6344
diff changeset
     8
  adding bar
8f258dd4ed02 tests: unify test-rebuildstate
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6344
diff changeset
     9
  adding foo
5065
b304c2496f52 dirstate: fix rebuild; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    10
12121
8f258dd4ed02 tests: unify test-rebuildstate
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6344
diff changeset
    11
  $ touch baz
8f258dd4ed02 tests: unify test-rebuildstate
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6344
diff changeset
    12
  $ hg add baz
8f258dd4ed02 tests: unify test-rebuildstate
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6344
diff changeset
    13
  $ hg rm bar
5065
b304c2496f52 dirstate: fix rebuild; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    14
12121
8f258dd4ed02 tests: unify test-rebuildstate
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6344
diff changeset
    15
  $ hg debugrebuildstate
8f258dd4ed02 tests: unify test-rebuildstate
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6344
diff changeset
    16
8f258dd4ed02 tests: unify test-rebuildstate
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6344
diff changeset
    17
state dump after
8f258dd4ed02 tests: unify test-rebuildstate
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6344
diff changeset
    18
8f258dd4ed02 tests: unify test-rebuildstate
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6344
diff changeset
    19
  $ hg debugstate --nodates | sort
23840
ddc17eaf0f1b debugdirstate: don't hide date field with --nodate, just show 'set'/'unset'
Mads Kiilerich <madski@unity3d.com>
parents: 16913
diff changeset
    20
  n 644         -1 set                 bar
ddc17eaf0f1b debugdirstate: don't hide date field with --nodate, just show 'set'/'unset'
Mads Kiilerich <madski@unity3d.com>
parents: 16913
diff changeset
    21
  n 644         -1 set                 foo
5065
b304c2496f52 dirstate: fix rebuild; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    22
12121
8f258dd4ed02 tests: unify test-rebuildstate
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6344
diff changeset
    23
status
5065
b304c2496f52 dirstate: fix rebuild; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    24
12121
8f258dd4ed02 tests: unify test-rebuildstate
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6344
diff changeset
    25
  $ hg st -A
8f258dd4ed02 tests: unify test-rebuildstate
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6344
diff changeset
    26
  ! bar
8f258dd4ed02 tests: unify test-rebuildstate
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6344
diff changeset
    27
  ? baz
8f258dd4ed02 tests: unify test-rebuildstate
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6344
diff changeset
    28
  C foo
8f258dd4ed02 tests: unify test-rebuildstate
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6344
diff changeset
    29
16913
f2719b387380 tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents: 15440
diff changeset
    30
  $ cd ..