tests/test-journal-exists.t
author Patrick Mezard <pmezard@gmail.com>
Tue, 15 Feb 2011 22:25:48 +0100
changeset 13411 d4de90a612f7
parent 12640 6cc4b14fb76b
child 15443 a1914d214579
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:
12205
b4d0d646b3f7 tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents: 9693
diff changeset
     1
  $ hg init
b4d0d646b3f7 tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents: 9693
diff changeset
     2
  $ echo a > a
b4d0d646b3f7 tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents: 9693
diff changeset
     3
  $ hg ci -Am0
b4d0d646b3f7 tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents: 9693
diff changeset
     4
  adding a
5865
e7127f669edb transactions: don't show a backtrace when journal exists
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
     5
12205
b4d0d646b3f7 tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents: 9693
diff changeset
     6
  $ hg -q clone . foo
b4d0d646b3f7 tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents: 9693
diff changeset
     7
b4d0d646b3f7 tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents: 9693
diff changeset
     8
  $ touch .hg/store/journal
5865
e7127f669edb transactions: don't show a backtrace when journal exists
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
     9
12205
b4d0d646b3f7 tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents: 9693
diff changeset
    10
  $ echo foo > a
b4d0d646b3f7 tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents: 9693
diff changeset
    11
  $ hg ci -Am0
b4d0d646b3f7 tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents: 9693
diff changeset
    12
  abort: abandoned transaction found - run hg recover!
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12205
diff changeset
    13
  [255]
5865
e7127f669edb transactions: don't show a backtrace when journal exists
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    14
12205
b4d0d646b3f7 tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents: 9693
diff changeset
    15
  $ hg recover
b4d0d646b3f7 tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents: 9693
diff changeset
    16
  rolling back interrupted transaction
b4d0d646b3f7 tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents: 9693
diff changeset
    17
  checking changesets
b4d0d646b3f7 tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents: 9693
diff changeset
    18
  checking manifests
b4d0d646b3f7 tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents: 9693
diff changeset
    19
  crosschecking files in changesets and manifests
b4d0d646b3f7 tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents: 9693
diff changeset
    20
  checking files
b4d0d646b3f7 tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents: 9693
diff changeset
    21
  1 files, 1 changesets, 1 total revisions
5865
e7127f669edb transactions: don't show a backtrace when journal exists
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    22
12205
b4d0d646b3f7 tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents: 9693
diff changeset
    23
Check that zero-size journals are correctly aborted:
9693
c40a1ee20aa5 transaction: always remove empty journal on abort
Sune Foldager <cryo@cyanite.org>
parents: 5867
diff changeset
    24
12205
b4d0d646b3f7 tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents: 9693
diff changeset
    25
  $ hg bundle -qa repo.hg
b4d0d646b3f7 tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents: 9693
diff changeset
    26
  $ chmod -w foo/.hg/store/00changelog.i
b4d0d646b3f7 tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents: 9693
diff changeset
    27
b4d0d646b3f7 tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents: 9693
diff changeset
    28
  $ hg -R foo unbundle repo.hg
b4d0d646b3f7 tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents: 9693
diff changeset
    29
  adding changesets
12640
6cc4b14fb76b tests: remove redundant globs
Mads Kiilerich <mads@kiilerich.com>
parents: 12376
diff changeset
    30
  abort: Permission denied: $TESTTMP/foo/.hg/store/.00changelog.i-* (glob)
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12205
diff changeset
    31
  [255]
12205
b4d0d646b3f7 tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents: 9693
diff changeset
    32
b4d0d646b3f7 tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents: 9693
diff changeset
    33
  $ if test -f foo/.hg/store/journal; then echo 'journal exists :-('; fi
b4d0d646b3f7 tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents: 9693
diff changeset
    34