tests/test-revert-unknown.t
author Yuya Nishihara <yuya@tcha.org>
Sun, 14 Jan 2018 13:29:15 +0900
changeset 35741 73432eee0ac4
parent 12156 4c94b6d0fb1c
child 44724 5c2a4f37eace
permissions -rw-r--r--
fileset: add kind:pat operator ":" isn't taken as a symbol character but an infix operator so we can write e.g. "path:'foo bar'" as well as "'path:foo bar'". An invalid pattern kind is rejected in the former form as we know a kind is specified explicitly. The binding strength is copied from "x:y" range operator of revset. Perhaps it can be adjusted later if we want to parse "foo:bar()" as "(foo:bar)()", not "foo:(bar())". We can also add "kind:" postfix operator if we want. One possible confusion is that the scope of the leading "set:" vs "kind:pat" operator. The former is consumed by a matcher so applies to the whole fileset expression: $ hg files 'set:foo() or kind:bar or baz' ^^^^^^^^^^^^^^^^^^^^^^^^ Whereas the scope of kind:pat operator is narrow: $ hg files 'set:foo() or kind:bar or baz' ^^^

  $ hg init
  $ touch unknown

  $ touch a
  $ hg add a
  $ hg ci -m "1"

  $ touch b
  $ hg add b
  $ hg ci -m "2"

Should show unknown

  $ hg status
  ? unknown
  $ hg revert -r 0 --all
  removing b

Should show unknown and b removed

  $ hg status
  R b
  ? unknown

Should show a and unknown

  $ ls
  a
  unknown