view tests/test-nested-repo.t @ 25308:036c26b08b71

revset: add helper to build balanced addsets from chained 'or' operations This function will be used by revset.orset() and scmutil.revrange() to reduce the stack depth from O(n) to O(log(n)). We've bikeshed the interface of this function, but we couldn't come to an agreement. So we decided to attempt to make it move forward. marmoute: - new factory function isn't necessary for balanced addsets - addset.__init__ can just recurse, should handle "len(subsets) == 2+" yuja: - want to write all "len(subsets) == 0, 1, 2, 3+" cases in the same function - no recursion in __init__ for cosmetic reason: can't return, can't call __init__ directly I've changed it to a private function so that nobody would be tempted to utilize it.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 24 May 2015 14:10:52 +0900
parents 4cdec37f0018
children 4441705b7111
line wrap: on
line source

  $ hg init a
  $ cd a
  $ hg init b
  $ echo x > b/x

Should print nothing:

  $ hg add b
  $ hg st

  $ echo y > b/y
  $ hg st

Should fail:

  $ hg st b/x
  abort: path 'b/x' is inside nested repo 'b' (glob)
  [255]
  $ hg add b/x
  abort: path 'b/x' is inside nested repo 'b' (glob)
  [255]

Should fail:

  $ hg add b b/x
  abort: path 'b/x' is inside nested repo 'b' (glob)
  [255]
  $ hg st

Should arguably print nothing:

  $ hg st b

  $ echo a > a
  $ hg ci -Ama a

Should fail:

  $ hg mv a b
  abort: path 'b/a' is inside nested repo 'b' (glob)
  [255]
  $ hg st

  $ cd ..