tests/test-inotify-dirty-dirstate.t
author Patrick Mezard <pmezard@gmail.com>
Tue, 15 Feb 2011 22:25:48 +0100
changeset 13411 d4de90a612f7
parent 12452 f727db60abb4
child 13956 ffb5c09ba822
permissions -rw-r--r--
commit: abort if a subrepo is modified and ui.commitsubrepos=no The default behaviour is to commit subrepositories with uncommitted changes. In my experience this is usually undesirable: - Changes to dependencies are often debugging leftovers - Real changes should generally be applied on the source project directly, tested then committed. This is not always possible, subversion subrepos may include only a small part of the source project, without the tests. Setting ui.commitsubrepos=no will now abort commits containing such modified subrepositories like: $ hg --config ui.commitsubrepos=no ci -m msg abort: uncommitted changes in subrepo sub I ruled out the hook solution because it does not easily take --include/exclude options in account. Also, my main concern is whether this flag could cause problems with extensions. If there are legitimate reasons for callers to override this behaviour (I could not find any), they might either override at ui level, or we could add an argument to localrepo.commit() later. v2: - Renamed ui.commitsubs to ui.commitsubrepos - Mention the configuration entry in hg help subrepos
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12452
f727db60abb4 tests: unify test-inotify-dirty-dirstate
Matt Mackall <mpm@selenic.com>
parents: 9897
diff changeset
     1
issues when status queries are issued when dirstate is dirty
9855
f47c0881b16e inotify: Do not access inotify when dirstate is dirty (issue1811)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
diff changeset
     2
12452
f727db60abb4 tests: unify test-inotify-dirty-dirstate
Matt Mackall <mpm@selenic.com>
parents: 9897
diff changeset
     3
  $ "$TESTDIR/hghave" inotify || exit 80
f727db60abb4 tests: unify test-inotify-dirty-dirstate
Matt Mackall <mpm@selenic.com>
parents: 9897
diff changeset
     4
  $ echo "[extensions]" >> $HGRCPATH
f727db60abb4 tests: unify test-inotify-dirty-dirstate
Matt Mackall <mpm@selenic.com>
parents: 9897
diff changeset
     5
  $ echo "inotify=" >> $HGRCPATH
f727db60abb4 tests: unify test-inotify-dirty-dirstate
Matt Mackall <mpm@selenic.com>
parents: 9897
diff changeset
     6
  $ echo "fetch=" >> $HGRCPATH
9855
f47c0881b16e inotify: Do not access inotify when dirstate is dirty (issue1811)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
diff changeset
     7
12452
f727db60abb4 tests: unify test-inotify-dirty-dirstate
Matt Mackall <mpm@selenic.com>
parents: 9897
diff changeset
     8
issue1810: inotify and fetch
9855
f47c0881b16e inotify: Do not access inotify when dirstate is dirty (issue1811)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
diff changeset
     9
12452
f727db60abb4 tests: unify test-inotify-dirty-dirstate
Matt Mackall <mpm@selenic.com>
parents: 9897
diff changeset
    10
  $ mkdir test; cd test
f727db60abb4 tests: unify test-inotify-dirty-dirstate
Matt Mackall <mpm@selenic.com>
parents: 9897
diff changeset
    11
  $ hg init
f727db60abb4 tests: unify test-inotify-dirty-dirstate
Matt Mackall <mpm@selenic.com>
parents: 9897
diff changeset
    12
  $ hg inserve -d --pid-file=../hg.pid
f727db60abb4 tests: unify test-inotify-dirty-dirstate
Matt Mackall <mpm@selenic.com>
parents: 9897
diff changeset
    13
  $ cat ../hg.pid >> "$DAEMON_PIDS"
f727db60abb4 tests: unify test-inotify-dirty-dirstate
Matt Mackall <mpm@selenic.com>
parents: 9897
diff changeset
    14
  $ echo foo > foo
f727db60abb4 tests: unify test-inotify-dirty-dirstate
Matt Mackall <mpm@selenic.com>
parents: 9897
diff changeset
    15
  $ hg add
f727db60abb4 tests: unify test-inotify-dirty-dirstate
Matt Mackall <mpm@selenic.com>
parents: 9897
diff changeset
    16
  adding foo
f727db60abb4 tests: unify test-inotify-dirty-dirstate
Matt Mackall <mpm@selenic.com>
parents: 9897
diff changeset
    17
  $ hg ci -m foo
f727db60abb4 tests: unify test-inotify-dirty-dirstate
Matt Mackall <mpm@selenic.com>
parents: 9897
diff changeset
    18
  $ cd ..
f727db60abb4 tests: unify test-inotify-dirty-dirstate
Matt Mackall <mpm@selenic.com>
parents: 9897
diff changeset
    19
  $ hg --config "inotify.pidfile=../hg2.pid" clone test test2
f727db60abb4 tests: unify test-inotify-dirty-dirstate
Matt Mackall <mpm@selenic.com>
parents: 9897
diff changeset
    20
  updating to branch default
f727db60abb4 tests: unify test-inotify-dirty-dirstate
Matt Mackall <mpm@selenic.com>
parents: 9897
diff changeset
    21
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
f727db60abb4 tests: unify test-inotify-dirty-dirstate
Matt Mackall <mpm@selenic.com>
parents: 9897
diff changeset
    22
  $ cat ../hg2.pid >> "$DAEMON_PIDS"
f727db60abb4 tests: unify test-inotify-dirty-dirstate
Matt Mackall <mpm@selenic.com>
parents: 9897
diff changeset
    23
  $ cd test2
f727db60abb4 tests: unify test-inotify-dirty-dirstate
Matt Mackall <mpm@selenic.com>
parents: 9897
diff changeset
    24
  $ echo bar > bar
f727db60abb4 tests: unify test-inotify-dirty-dirstate
Matt Mackall <mpm@selenic.com>
parents: 9897
diff changeset
    25
  $ hg add
f727db60abb4 tests: unify test-inotify-dirty-dirstate
Matt Mackall <mpm@selenic.com>
parents: 9897
diff changeset
    26
  adding bar
f727db60abb4 tests: unify test-inotify-dirty-dirstate
Matt Mackall <mpm@selenic.com>
parents: 9897
diff changeset
    27
  $ hg ci -m bar
f727db60abb4 tests: unify test-inotify-dirty-dirstate
Matt Mackall <mpm@selenic.com>
parents: 9897
diff changeset
    28
  $ cd ../test
f727db60abb4 tests: unify test-inotify-dirty-dirstate
Matt Mackall <mpm@selenic.com>
parents: 9897
diff changeset
    29
  $ echo spam > spam
f727db60abb4 tests: unify test-inotify-dirty-dirstate
Matt Mackall <mpm@selenic.com>
parents: 9897
diff changeset
    30
  $ hg add
f727db60abb4 tests: unify test-inotify-dirty-dirstate
Matt Mackall <mpm@selenic.com>
parents: 9897
diff changeset
    31
  adding spam
f727db60abb4 tests: unify test-inotify-dirty-dirstate
Matt Mackall <mpm@selenic.com>
parents: 9897
diff changeset
    32
  $ hg ci -m spam
f727db60abb4 tests: unify test-inotify-dirty-dirstate
Matt Mackall <mpm@selenic.com>
parents: 9897
diff changeset
    33
  $ cd ../test2
f727db60abb4 tests: unify test-inotify-dirty-dirstate
Matt Mackall <mpm@selenic.com>
parents: 9897
diff changeset
    34
  $ hg st
9855
f47c0881b16e inotify: Do not access inotify when dirstate is dirty (issue1811)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
diff changeset
    35
12452
f727db60abb4 tests: unify test-inotify-dirty-dirstate
Matt Mackall <mpm@selenic.com>
parents: 9897
diff changeset
    36
abort, outstanding changes
9855
f47c0881b16e inotify: Do not access inotify when dirstate is dirty (issue1811)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
diff changeset
    37
12452
f727db60abb4 tests: unify test-inotify-dirty-dirstate
Matt Mackall <mpm@selenic.com>
parents: 9897
diff changeset
    38
  $ hg fetch -q
f727db60abb4 tests: unify test-inotify-dirty-dirstate
Matt Mackall <mpm@selenic.com>
parents: 9897
diff changeset
    39
  $ hg st
f727db60abb4 tests: unify test-inotify-dirty-dirstate
Matt Mackall <mpm@selenic.com>
parents: 9897
diff changeset
    40
  $ cd ..
9855
f47c0881b16e inotify: Do not access inotify when dirstate is dirty (issue1811)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
diff changeset
    41
12452
f727db60abb4 tests: unify test-inotify-dirty-dirstate
Matt Mackall <mpm@selenic.com>
parents: 9897
diff changeset
    42
issue1719: inotify and mq
9855
f47c0881b16e inotify: Do not access inotify when dirstate is dirty (issue1811)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
diff changeset
    43
12452
f727db60abb4 tests: unify test-inotify-dirty-dirstate
Matt Mackall <mpm@selenic.com>
parents: 9897
diff changeset
    44
  $ echo "mq=" >> $HGRCPATH
f727db60abb4 tests: unify test-inotify-dirty-dirstate
Matt Mackall <mpm@selenic.com>
parents: 9897
diff changeset
    45
  $ hg init test-1719
f727db60abb4 tests: unify test-inotify-dirty-dirstate
Matt Mackall <mpm@selenic.com>
parents: 9897
diff changeset
    46
  $ cd test-1719
9855
f47c0881b16e inotify: Do not access inotify when dirstate is dirty (issue1811)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
diff changeset
    47
12452
f727db60abb4 tests: unify test-inotify-dirty-dirstate
Matt Mackall <mpm@selenic.com>
parents: 9897
diff changeset
    48
inserve
9855
f47c0881b16e inotify: Do not access inotify when dirstate is dirty (issue1811)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
diff changeset
    49
12452
f727db60abb4 tests: unify test-inotify-dirty-dirstate
Matt Mackall <mpm@selenic.com>
parents: 9897
diff changeset
    50
  $ hg inserve -d --pid-file=../hg-test-1719.pid
f727db60abb4 tests: unify test-inotify-dirty-dirstate
Matt Mackall <mpm@selenic.com>
parents: 9897
diff changeset
    51
  $ cat ../hg-test-1719.pid >> "$DAEMON_PIDS"
f727db60abb4 tests: unify test-inotify-dirty-dirstate
Matt Mackall <mpm@selenic.com>
parents: 9897
diff changeset
    52
  $ echo content > file
f727db60abb4 tests: unify test-inotify-dirty-dirstate
Matt Mackall <mpm@selenic.com>
parents: 9897
diff changeset
    53
  $ hg add file
f727db60abb4 tests: unify test-inotify-dirty-dirstate
Matt Mackall <mpm@selenic.com>
parents: 9897
diff changeset
    54
  $ hg qnew -f test.patch
f727db60abb4 tests: unify test-inotify-dirty-dirstate
Matt Mackall <mpm@selenic.com>
parents: 9897
diff changeset
    55
  $ hg status
f727db60abb4 tests: unify test-inotify-dirty-dirstate
Matt Mackall <mpm@selenic.com>
parents: 9897
diff changeset
    56
  $ hg qpop
f727db60abb4 tests: unify test-inotify-dirty-dirstate
Matt Mackall <mpm@selenic.com>
parents: 9897
diff changeset
    57
  popping test.patch
f727db60abb4 tests: unify test-inotify-dirty-dirstate
Matt Mackall <mpm@selenic.com>
parents: 9897
diff changeset
    58
  patch queue now empty
9855
f47c0881b16e inotify: Do not access inotify when dirstate is dirty (issue1811)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
diff changeset
    59
12452
f727db60abb4 tests: unify test-inotify-dirty-dirstate
Matt Mackall <mpm@selenic.com>
parents: 9897
diff changeset
    60
st should not output anything
9855
f47c0881b16e inotify: Do not access inotify when dirstate is dirty (issue1811)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
diff changeset
    61
12452
f727db60abb4 tests: unify test-inotify-dirty-dirstate
Matt Mackall <mpm@selenic.com>
parents: 9897
diff changeset
    62
  $ hg status
f727db60abb4 tests: unify test-inotify-dirty-dirstate
Matt Mackall <mpm@selenic.com>
parents: 9897
diff changeset
    63
  $ hg qpush
f727db60abb4 tests: unify test-inotify-dirty-dirstate
Matt Mackall <mpm@selenic.com>
parents: 9897
diff changeset
    64
  applying test.patch
f727db60abb4 tests: unify test-inotify-dirty-dirstate
Matt Mackall <mpm@selenic.com>
parents: 9897
diff changeset
    65
  now at: test.patch
9855
f47c0881b16e inotify: Do not access inotify when dirstate is dirty (issue1811)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
diff changeset
    66
12452
f727db60abb4 tests: unify test-inotify-dirty-dirstate
Matt Mackall <mpm@selenic.com>
parents: 9897
diff changeset
    67
st should not output anything
f727db60abb4 tests: unify test-inotify-dirty-dirstate
Matt Mackall <mpm@selenic.com>
parents: 9897
diff changeset
    68
f727db60abb4 tests: unify test-inotify-dirty-dirstate
Matt Mackall <mpm@selenic.com>
parents: 9897
diff changeset
    69
  $ hg status
f727db60abb4 tests: unify test-inotify-dirty-dirstate
Matt Mackall <mpm@selenic.com>
parents: 9897
diff changeset
    70
  $ hg qrefresh
f727db60abb4 tests: unify test-inotify-dirty-dirstate
Matt Mackall <mpm@selenic.com>
parents: 9897
diff changeset
    71
  $ hg status