tests/test-diff-reverse.t
author Patrick Mezard <pmezard@gmail.com>
Tue, 15 Feb 2011 22:25:48 +0100
changeset 13411 d4de90a612f7
parent 12139 5a69ea8d65b3
child 23080 c586cb50872b
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:
12139
5a69ea8d65b3 tests: unify test-diff-reverse
Adrian Buehlmann <adrian@cadifra.com>
parents: 9857
diff changeset
     1
  $ hg init
9725
3f522d2fa633 diff: add --inverse option
Yannick Gingras <ygingras@ygingras.net>
parents:
diff changeset
     2
12139
5a69ea8d65b3 tests: unify test-diff-reverse
Adrian Buehlmann <adrian@cadifra.com>
parents: 9857
diff changeset
     3
  $ cat > a <<EOF
5a69ea8d65b3 tests: unify test-diff-reverse
Adrian Buehlmann <adrian@cadifra.com>
parents: 9857
diff changeset
     4
  > a
5a69ea8d65b3 tests: unify test-diff-reverse
Adrian Buehlmann <adrian@cadifra.com>
parents: 9857
diff changeset
     5
  > b
5a69ea8d65b3 tests: unify test-diff-reverse
Adrian Buehlmann <adrian@cadifra.com>
parents: 9857
diff changeset
     6
  > c
5a69ea8d65b3 tests: unify test-diff-reverse
Adrian Buehlmann <adrian@cadifra.com>
parents: 9857
diff changeset
     7
  > EOF
5a69ea8d65b3 tests: unify test-diff-reverse
Adrian Buehlmann <adrian@cadifra.com>
parents: 9857
diff changeset
     8
  $ hg ci -Am adda
5a69ea8d65b3 tests: unify test-diff-reverse
Adrian Buehlmann <adrian@cadifra.com>
parents: 9857
diff changeset
     9
  adding a
5a69ea8d65b3 tests: unify test-diff-reverse
Adrian Buehlmann <adrian@cadifra.com>
parents: 9857
diff changeset
    10
5a69ea8d65b3 tests: unify test-diff-reverse
Adrian Buehlmann <adrian@cadifra.com>
parents: 9857
diff changeset
    11
  $ cat > a <<EOF
5a69ea8d65b3 tests: unify test-diff-reverse
Adrian Buehlmann <adrian@cadifra.com>
parents: 9857
diff changeset
    12
  > d
5a69ea8d65b3 tests: unify test-diff-reverse
Adrian Buehlmann <adrian@cadifra.com>
parents: 9857
diff changeset
    13
  > e
5a69ea8d65b3 tests: unify test-diff-reverse
Adrian Buehlmann <adrian@cadifra.com>
parents: 9857
diff changeset
    14
  > f
5a69ea8d65b3 tests: unify test-diff-reverse
Adrian Buehlmann <adrian@cadifra.com>
parents: 9857
diff changeset
    15
  > EOF
5a69ea8d65b3 tests: unify test-diff-reverse
Adrian Buehlmann <adrian@cadifra.com>
parents: 9857
diff changeset
    16
  $ hg ci -m moda
9725
3f522d2fa633 diff: add --inverse option
Yannick Gingras <ygingras@ygingras.net>
parents:
diff changeset
    17
12139
5a69ea8d65b3 tests: unify test-diff-reverse
Adrian Buehlmann <adrian@cadifra.com>
parents: 9857
diff changeset
    18
  $ hg diff --reverse -r0 -r1
5a69ea8d65b3 tests: unify test-diff-reverse
Adrian Buehlmann <adrian@cadifra.com>
parents: 9857
diff changeset
    19
  diff -r 2855cdcfcbb7 -r 8e1805a3cf6e a
5a69ea8d65b3 tests: unify test-diff-reverse
Adrian Buehlmann <adrian@cadifra.com>
parents: 9857
diff changeset
    20
  --- a/a	Thu Jan 01 00:00:00 1970 +0000
5a69ea8d65b3 tests: unify test-diff-reverse
Adrian Buehlmann <adrian@cadifra.com>
parents: 9857
diff changeset
    21
  +++ b/a	Thu Jan 01 00:00:00 1970 +0000
5a69ea8d65b3 tests: unify test-diff-reverse
Adrian Buehlmann <adrian@cadifra.com>
parents: 9857
diff changeset
    22
  @@ -1,3 +1,3 @@
5a69ea8d65b3 tests: unify test-diff-reverse
Adrian Buehlmann <adrian@cadifra.com>
parents: 9857
diff changeset
    23
  -d
5a69ea8d65b3 tests: unify test-diff-reverse
Adrian Buehlmann <adrian@cadifra.com>
parents: 9857
diff changeset
    24
  -e
5a69ea8d65b3 tests: unify test-diff-reverse
Adrian Buehlmann <adrian@cadifra.com>
parents: 9857
diff changeset
    25
  -f
5a69ea8d65b3 tests: unify test-diff-reverse
Adrian Buehlmann <adrian@cadifra.com>
parents: 9857
diff changeset
    26
  +a
5a69ea8d65b3 tests: unify test-diff-reverse
Adrian Buehlmann <adrian@cadifra.com>
parents: 9857
diff changeset
    27
  +b
5a69ea8d65b3 tests: unify test-diff-reverse
Adrian Buehlmann <adrian@cadifra.com>
parents: 9857
diff changeset
    28
  +c
9725
3f522d2fa633 diff: add --inverse option
Yannick Gingras <ygingras@ygingras.net>
parents:
diff changeset
    29
12139
5a69ea8d65b3 tests: unify test-diff-reverse
Adrian Buehlmann <adrian@cadifra.com>
parents: 9857
diff changeset
    30
  $ cat >> a <<EOF
5a69ea8d65b3 tests: unify test-diff-reverse
Adrian Buehlmann <adrian@cadifra.com>
parents: 9857
diff changeset
    31
  > g
5a69ea8d65b3 tests: unify test-diff-reverse
Adrian Buehlmann <adrian@cadifra.com>
parents: 9857
diff changeset
    32
  > h
5a69ea8d65b3 tests: unify test-diff-reverse
Adrian Buehlmann <adrian@cadifra.com>
parents: 9857
diff changeset
    33
  > EOF
5a69ea8d65b3 tests: unify test-diff-reverse
Adrian Buehlmann <adrian@cadifra.com>
parents: 9857
diff changeset
    34
  $ hg diff --reverse --nodates
5a69ea8d65b3 tests: unify test-diff-reverse
Adrian Buehlmann <adrian@cadifra.com>
parents: 9857
diff changeset
    35
  diff -r 2855cdcfcbb7 a
5a69ea8d65b3 tests: unify test-diff-reverse
Adrian Buehlmann <adrian@cadifra.com>
parents: 9857
diff changeset
    36
  --- a/a
5a69ea8d65b3 tests: unify test-diff-reverse
Adrian Buehlmann <adrian@cadifra.com>
parents: 9857
diff changeset
    37
  +++ b/a
5a69ea8d65b3 tests: unify test-diff-reverse
Adrian Buehlmann <adrian@cadifra.com>
parents: 9857
diff changeset
    38
  @@ -1,5 +1,3 @@
5a69ea8d65b3 tests: unify test-diff-reverse
Adrian Buehlmann <adrian@cadifra.com>
parents: 9857
diff changeset
    39
   d
5a69ea8d65b3 tests: unify test-diff-reverse
Adrian Buehlmann <adrian@cadifra.com>
parents: 9857
diff changeset
    40
   e
5a69ea8d65b3 tests: unify test-diff-reverse
Adrian Buehlmann <adrian@cadifra.com>
parents: 9857
diff changeset
    41
   f
5a69ea8d65b3 tests: unify test-diff-reverse
Adrian Buehlmann <adrian@cadifra.com>
parents: 9857
diff changeset
    42
  -g
5a69ea8d65b3 tests: unify test-diff-reverse
Adrian Buehlmann <adrian@cadifra.com>
parents: 9857
diff changeset
    43
  -h
9725
3f522d2fa633 diff: add --inverse option
Yannick Gingras <ygingras@ygingras.net>
parents:
diff changeset
    44