tests/test-fileset.t
author Patrick Mezard <patrick@mezard.eu>
Wed, 15 Aug 2012 19:02:04 +0200
branchstable
changeset 17363 5d9e2031c0b1
parent 17362 bd867a9ca510
child 17364 0c41fb2d972a
permissions -rw-r--r--
fileset: actually implement 'minusset' $ hg debugfileset 'a* - a1' was tracing back because 'minus' symbol was not supported.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
17362
bd867a9ca510 tests: test filesets with test-fileset.t
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
     1
  $ fileset() {
bd867a9ca510 tests: test filesets with test-fileset.t
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
     2
  >   hg debugfileset "$@"
bd867a9ca510 tests: test filesets with test-fileset.t
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
     3
  > }
bd867a9ca510 tests: test filesets with test-fileset.t
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
     4
bd867a9ca510 tests: test filesets with test-fileset.t
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
     5
  $ hg init repo
bd867a9ca510 tests: test filesets with test-fileset.t
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
     6
  $ cd repo
bd867a9ca510 tests: test filesets with test-fileset.t
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
     7
  $ echo a > a1
bd867a9ca510 tests: test filesets with test-fileset.t
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
     8
  $ echo a > a2
bd867a9ca510 tests: test filesets with test-fileset.t
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
     9
  $ echo b > b1
bd867a9ca510 tests: test filesets with test-fileset.t
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    10
  $ hg ci -Am addfiles
bd867a9ca510 tests: test filesets with test-fileset.t
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    11
  adding a1
bd867a9ca510 tests: test filesets with test-fileset.t
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    12
  adding a2
bd867a9ca510 tests: test filesets with test-fileset.t
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    13
  adding b1
bd867a9ca510 tests: test filesets with test-fileset.t
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    14
bd867a9ca510 tests: test filesets with test-fileset.t
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    15
Test operators and basic patterns
bd867a9ca510 tests: test filesets with test-fileset.t
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    16
bd867a9ca510 tests: test filesets with test-fileset.t
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    17
  $ fileset a1
bd867a9ca510 tests: test filesets with test-fileset.t
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    18
  a1
bd867a9ca510 tests: test filesets with test-fileset.t
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    19
  $ fileset 'a*'
bd867a9ca510 tests: test filesets with test-fileset.t
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    20
  a1
bd867a9ca510 tests: test filesets with test-fileset.t
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    21
  a2
bd867a9ca510 tests: test filesets with test-fileset.t
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    22
  $ fileset '"re:a\d"'
bd867a9ca510 tests: test filesets with test-fileset.t
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    23
  a1
bd867a9ca510 tests: test filesets with test-fileset.t
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    24
  a2
bd867a9ca510 tests: test filesets with test-fileset.t
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    25
  $ fileset 'a1 or a2'
bd867a9ca510 tests: test filesets with test-fileset.t
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    26
  a1
bd867a9ca510 tests: test filesets with test-fileset.t
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    27
  a2
bd867a9ca510 tests: test filesets with test-fileset.t
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    28
  $ fileset 'a1 | a2'
bd867a9ca510 tests: test filesets with test-fileset.t
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    29
  a1
bd867a9ca510 tests: test filesets with test-fileset.t
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    30
  a2
bd867a9ca510 tests: test filesets with test-fileset.t
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    31
  $ fileset 'a* and "*1"'
bd867a9ca510 tests: test filesets with test-fileset.t
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    32
  a1
bd867a9ca510 tests: test filesets with test-fileset.t
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    33
  $ fileset 'a* & "*1"'
bd867a9ca510 tests: test filesets with test-fileset.t
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    34
  a1
bd867a9ca510 tests: test filesets with test-fileset.t
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    35
  $ fileset 'not (r"a*")'
bd867a9ca510 tests: test filesets with test-fileset.t
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    36
  b1
bd867a9ca510 tests: test filesets with test-fileset.t
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    37
  $ fileset '! ("a*")'
bd867a9ca510 tests: test filesets with test-fileset.t
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    38
  b1
17363
5d9e2031c0b1 fileset: actually implement 'minusset'
Patrick Mezard <patrick@mezard.eu>
parents: 17362
diff changeset
    39
  $ fileset 'a* - a1'
5d9e2031c0b1 fileset: actually implement 'minusset'
Patrick Mezard <patrick@mezard.eu>
parents: 17362
diff changeset
    40
  a2
17362
bd867a9ca510 tests: test filesets with test-fileset.t
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    41