tests/test-push-hook-lock.t
author Matt Harbison <matt_harbison@yahoo.com>
Sat, 16 May 2015 00:36:35 -0400
changeset 25122 755d23a49170
parent 23349 7dd1870120b2
child 25126 00e4c5601c74
permissions -rw-r--r--
match: resolve filesets in subrepos for commands given the '-S' argument This will work for any command that creates its matcher via scmutil.match(), but only the files command is tested here (both workingctx and basectx based tests). The previous behavior was to completely ignore the files in the subrepo, even though -S was given. My first attempt was to teach context.walk() to optionally recurse, but once that was in place and the complete file list was built up, the predicate test would fail with 'path in nested repo' when a file in a subrepo was accessed through the parent context. There are two slightly surprising behaviors with this functionality. First, any path provided inside the fileset isn't narrowed when it is passed to the subrepo. I dont see any clean way to do that in the matcher. Fortunately, the 'subrepo()' fileset is the only one to take a path. The second surprise is that status predicates are resolved against the subrepo, not the parent like 'hg status -S' is. I don't see any way to fix that either, given the path auditor error mentioned above.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 1839
diff changeset
     1
  $ hg init 1
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 1839
diff changeset
     2
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 1839
diff changeset
     3
  $ echo '[ui]' >> 1/.hg/hgrc
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 1839
diff changeset
     4
  $ echo 'timeout = 10' >> 1/.hg/hgrc
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 1839
diff changeset
     5
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 1839
diff changeset
     6
  $ echo foo > 1/foo
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 1839
diff changeset
     7
  $ hg --cwd 1 ci -A -m foo
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 1839
diff changeset
     8
  adding foo
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 1839
diff changeset
     9
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 1839
diff changeset
    10
  $ hg clone 1 2
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 1839
diff changeset
    11
  updating to branch default
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 1839
diff changeset
    12
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 1839
diff changeset
    13
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 1839
diff changeset
    14
  $ hg clone 2 3
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 1839
diff changeset
    15
  updating to branch default
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 1839
diff changeset
    16
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 1839
diff changeset
    17
23349
7dd1870120b2 tests: move a multi-statement debuglocks hook into a shell script for Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 22559
diff changeset
    18
  $ cat <<EOF > $TESTTMP/debuglocks-pretxn-hook.sh
7dd1870120b2 tests: move a multi-statement debuglocks hook into a shell script for Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 22559
diff changeset
    19
  > hg debuglocks
7dd1870120b2 tests: move a multi-statement debuglocks hook into a shell script for Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 22559
diff changeset
    20
  > true
7dd1870120b2 tests: move a multi-statement debuglocks hook into a shell script for Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 22559
diff changeset
    21
  > EOF
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 1839
diff changeset
    22
  $ echo '[hooks]' >> 2/.hg/hgrc
23349
7dd1870120b2 tests: move a multi-statement debuglocks hook into a shell script for Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 22559
diff changeset
    23
  $ echo "pretxnchangegroup.a = sh $TESTTMP/debuglocks-pretxn-hook.sh" >> 2/.hg/hgrc
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 1839
diff changeset
    24
  $ echo 'changegroup.push = hg push -qf ../1' >> 2/.hg/hgrc
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 1839
diff changeset
    25
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 1839
diff changeset
    26
  $ echo bar >> 3/foo
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 1839
diff changeset
    27
  $ hg --cwd 3 ci -m bar
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 1839
diff changeset
    28
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 1839
diff changeset
    29
  $ hg --cwd 3 push ../2
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 1839
diff changeset
    30
  pushing to ../2
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 1839
diff changeset
    31
  searching for changes
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 1839
diff changeset
    32
  adding changesets
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 1839
diff changeset
    33
  adding manifests
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 1839
diff changeset
    34
  adding file changes
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 1839
diff changeset
    35
  added 1 changesets with 1 changes to 1 files
22559
4e0b696a1cb3 commands: add debuglocks to report/clear lock state
Matt Mackall <mpm@selenic.com>
parents: 12279
diff changeset
    36
  lock:  user *, process * (*s) (glob)
4e0b696a1cb3 commands: add debuglocks to report/clear lock state
Matt Mackall <mpm@selenic.com>
parents: 12279
diff changeset
    37
  wlock: free
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 1839
diff changeset
    38