tests/test-diff-indent-heuristic.t
author Gregory Szorc <gregory.szorc@gmail.com>
Mon, 24 Sep 2018 09:41:42 -0700
changeset 39861 db5501d93bcf
parent 36678 7834927f0243
child 49621 55c6ebd11cb9
permissions -rw-r--r--
changegroup: remove reordering control (BC) This logic - including the experimental bundle.reorder option - was originally added in a8e3931e3fb5 in 2011 and then later ported to changegroup.py. The intent of this option and associated logic is to control the ordering of revisions in deltagroups in changegroups. At the time it was implemented, only changegroup version 1 existed and generaldelta revlogs were just coming into the world. Changegroup version 1 requires that deltas be made against the last revision sent over the wire. Used with generaldelta, this created an impedance mismatch of sorts and resulted in changegroup producers spending a lot of time recomputing deltas. Revision reordering was introduced so outgoing revisions would be sent in "generaldelta order" and producers would be able to reuse internal deltas from storage. Later on, we introduced changegroup version 2. It supported denoting which revision a delta was against. So we no longer needed to sort outgoing revisions to ensure optimal delta generation from the producer. So, subsequent changegroup versions disabled reordering. We also later made the changelog not store deltas by default. And we also made the changelog send out deltas in storage order. Why we do this for changelog, I'm not sure. Maybe we want to preserve revision order across clones? It doesn't really matter for this commit. Fast forward to 2018. We want to abstract storage backends. And having changegroup code require knowledge about how deltas are stored internally interferes with that goal. This commit removes reordering control from changegroup generation. After this commit, the reordering behavior is: * The changelog is always sent out in storage order (no behavior change). * Non-changelog generaldelta revlogs are reordered to always be in DAG topological order (previously, generaldelta revlogs would be emitted in storage order for version 2 and 3 changegroups). * Non-changelog non-generaldelta revlogs are sent in storage order (no behavior change). * There exists no config option to override behavior. The big difference here is that generaldelta revlogs now *always* have their revisions sorted in DAG order before going out over the wire. This behavior was previously only done for changegroup version 1. Version 2 and version 3 changegroups disabled reordering because the interchange format supported encoding arbitrary delta parents, so reordering wasn't strictly necessary. I can think of a few significant implications for this change. Because changegroup receivers will now see non-changelog revisions in DAG order instead of storage order, the internal storage order of manifests and files may differ substantially between producer and consumer. I don't think this matters that much, since the storage order of manifests and files is largely hidden from users. Only the storage order of changelog matters (because `hg log` shows the changelog in storage order). I don't think there should be any controversy here. The reordering of revisions has implications for changegroup producers. Previously, generaldelta revlogs would be emitted in storage order. And in the common case, the internally-stored delta could effectively be copied from disk into the deltagroup delta. This meant that emitting delta groups for generaldelta revlogs would be mostly linear read I/O. This is desirable for performance. With us now reordering generaldelta revlog revisions in DAG order, the read operations may use more random I/O instead of sequential I/O. This could result in performance loss. But with the prevalence of SSDs and fast random I/O, I'm not too worried. (Note: the optimal emission order for revlogs is actually delta encoding order. But the changegroup code wasn't doing that before or after this change. We could potentially implement that in a later commit.) Changegroups in DAG order will have implications for receivers. Previously, receiving storage order might mean seeing a number of interleaved branches. This would mean long delta chains, sparse I/O, and possibly more fulltext revisions instead of deltas, blowing up storage storage. (This is the same set of problems that sparse revlogs aims to address.) With the producer now sending revisions in DAG order, the receiver also stores revisions in DAG order. That means revisions for the same DAG branch are all grouped together. And this should yield better storage outcomes. In other words, sending the reordered changegroup allows the receiver to have better storage order and for the producer to not propagate its (possibly sub-optimal) internal storage order. On the mozilla-unified repository, this change influences bundle generation: $ hg bundle -t none-v2 -a before: time: real 355.680 secs (user 256.790+0.000 sys 16.820+0.000) after: time: real 382.950 secs (user 281.700+0.000 sys 17.690+0.000) before: 7,150,228,967 bytes (uncompressed) after: 7,041,556,273 bytes (uncompressed) before: 1,669,063,234 bytes (zstd l=3) after: 1,628,598,830 bytes (zstd l=3) $ hg unbundle before: time: real 511.910 secs (user 466.750+0.000 sys 32.680+0.000) after: time: real 487.790 secs (user 443.940+0.000 sys 30.840+0.000) 00manifest.d size: source: 274,924,292 bytes before: 304,741,626 bytes after: 245,252,087 bytes .hg/store total file size: source: 2,649,133,490 before: 2,680,888,130 after: 2,627,875,673 We see the bundle size drop. That's probably because if a revlog internally isn't storing a delta, it will choose to delta against the last emitted revision. And on repos with interleaved branches (like mozilla-unified), the previous revision could be an unrelated branch and therefore be a large delta. But with this patch, the previous revision is likely p1 or p2 and a delta should be small. We also see the manifest size drop by ~50 MB. It's worth noting that the manifest actually *increased* in size by ~25 MB in the old strategy and decreased ~25 MB from its source in the new strategy. Again, my explanation for this is that the DAG ordering in the changegroup is resulting in better grouping of revisions in the receiver, which results in more compact delta chains and higher storage efficiency. Unbundle time also dropped. I suspect this is due to the revlog having to work less to compute deltas since the incoming deltas are more optimal. i.e. the receiver spends less time resolving fulltext revisions as incoming deltas bounce around between DAG branches and delta chains. We also see bundle generation time increase. This is not desirable. However, the regression is only significant on the original repository: if we generate a bundle from the repository created from the new, always reordered bundles, we're close to baseline (if not at it with expected noise): $ hg bundle -t none-v2 -a before (original): time: real 355.680 secs (user 256.790+0.000 sys 16.820+0.000) after (original): time: real 382.950 secs (user 281.700+0.000 sys 17.690+0.000) after (new repo): time: real 362.280 secs (user 260.300+0.000 sys 17.700+0.000) This regression is a bit worrying because it will impact serving canonical repositories (that don't have optimal internal storage unless they are reordered - possibly as part of running `hg debugupgraderepo`). However, this regression will only be noticed by very large changegroups. And I'm guessing/hoping that any repository that large is using clonebundles to mitigate server load. Again, sending DAG order isn't the optimal send order for servers: sending in storage-delta order is. But in order to enable storage-optimal send order, we'll need a storage API that handles sorting. Future commits will introduce such an API. Differential Revision: https://phab.mercurial-scm.org/D4721
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
36678
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
     1
#testcases bdiff xdiff
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
     2
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
     3
#if xdiff
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
     4
#require xdiff
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
     5
  $ cat >> $HGRCPATH <<EOF
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
     6
  > [experimental]
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
     7
  > xdiff = true
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
     8
  > EOF
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
     9
#endif
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    10
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    11
  $ hg init
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    12
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    13
  $ cat > a.c <<'EOF'
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    14
  > /*
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    15
  >  * This function returns 1.
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    16
  >  */
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    17
  > int f() {
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    18
  >   return 1;
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    19
  > }
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    20
  > /*
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    21
  >  * This function returns 2.
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    22
  >  */
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    23
  > int g() {
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    24
  >   return 2;
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    25
  > }
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    26
  > /*
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    27
  >  * This function returns 3.
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    28
  >  */
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    29
  > int h() {
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    30
  >   return 3;
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    31
  > }
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    32
  > EOF
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    33
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    34
  $ cat > b.c <<'EOF'
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    35
  > if (x) {
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    36
  >    do_something();
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    37
  > }
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    38
  > 
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    39
  > if (y) {
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    40
  >    do_something_else();
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    41
  > }
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    42
  > EOF
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    43
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    44
  $ cat > c.rb <<'EOF'
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    45
  > #!ruby
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    46
  > ["foo", "bar", "baz"].map do |i|
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    47
  >   i.upcase
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    48
  > end
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    49
  > EOF
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    50
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    51
  $ cat > d.py <<'EOF'
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    52
  > try:
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    53
  >     import foo
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    54
  > except ImportError:
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    55
  >     pass
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    56
  > try:
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    57
  >     import bar
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    58
  > except ImportError:
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    59
  >     pass
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    60
  > EOF
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    61
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    62
The below two files are taken from git: t/t4061-diff-indent.sh
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    63
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    64
  $ cat > spaces.txt <<'EOF'
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    65
  > 1
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    66
  > 2
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    67
  > a
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    68
  > 
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    69
  > b
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    70
  > 3
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    71
  > 4
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    72
  > EOF
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    73
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    74
  $ cat > functions.c <<'EOF'
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    75
  > 1
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    76
  > 2
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    77
  > /* function */
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    78
  > foo() {
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    79
  >     foo
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    80
  > }
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    81
  > 
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    82
  > 3
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    83
  > 4
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    84
  > EOF
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    85
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    86
  $ hg commit -m 1 -A . -q
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    87
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    88
  $ cat > a.c <<'EOF'
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    89
  > /*
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    90
  >  * This function returns 1.
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    91
  >  */
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    92
  > int f() {
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    93
  >   return 1;
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    94
  > }
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    95
  > /*
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    96
  >  * This function returns 3.
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    97
  >  */
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    98
  > int h() {
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
    99
  >   return 3;
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   100
  > }
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   101
  > EOF
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   102
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   103
  $ cat > b.c <<'EOF'
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   104
  > if (x) {
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   105
  >    do_something();
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   106
  > }
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   107
  > 
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   108
  > if (y) {
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   109
  >    do_another_thing();
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   110
  > }
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   111
  > 
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   112
  > if (y) {
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   113
  >    do_something_else();
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   114
  > }
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   115
  > EOF
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   116
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   117
  $ cat > c.rb <<'EOF'
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   118
  > #!ruby
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   119
  > ["foo", "bar", "baz"].map do |i|
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   120
  >   i
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   121
  > end
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   122
  > ["foo", "bar", "baz"].map do |i|
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   123
  >   i.upcase
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   124
  > end
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   125
  > EOF
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   126
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   127
  $ cat > d.py <<'EOF'
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   128
  > try:
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   129
  >     import foo
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   130
  > except ImportError:
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   131
  >     pass
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   132
  > try:
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   133
  >     import baz
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   134
  > except ImportError:
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   135
  >     pass
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   136
  > try:
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   137
  >     import bar
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   138
  > except ImportError:
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   139
  >     pass
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   140
  > EOF
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   141
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   142
  $ cat > spaces.txt <<'EOF'
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   143
  > 1
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   144
  > 2
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   145
  > a
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   146
  > 
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   147
  > b
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   148
  > a
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   149
  > 
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   150
  > b
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   151
  > 3
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   152
  > 4
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   153
  > EOF
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   154
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   155
  $ cat > functions.c <<'EOF'
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   156
  > 1
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   157
  > 2
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   158
  > /* function */
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   159
  > bar() {
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   160
  >     foo
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   161
  > }
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   162
  > 
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   163
  > /* function */
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   164
  > foo() {
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   165
  >     foo
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   166
  > }
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   167
  > 
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   168
  > 3
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   169
  > 4
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   170
  > EOF
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   171
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   172
#if xdiff
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   173
  $ hg diff --git
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   174
  diff --git a/a.c b/a.c
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   175
  --- a/a.c
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   176
  +++ b/a.c
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   177
  @@ -4,12 +4,6 @@
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   178
   int f() {
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   179
     return 1;
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   180
   }
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   181
  -/*
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   182
  - * This function returns 2.
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   183
  - */
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   184
  -int g() {
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   185
  -  return 2;
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   186
  -}
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   187
   /*
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   188
    * This function returns 3.
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   189
    */
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   190
  diff --git a/b.c b/b.c
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   191
  --- a/b.c
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   192
  +++ b/b.c
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   193
  @@ -2,6 +2,10 @@
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   194
      do_something();
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   195
   }
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   196
   
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   197
  +if (y) {
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   198
  +   do_another_thing();
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   199
  +}
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   200
  +
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   201
   if (y) {
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   202
      do_something_else();
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   203
   }
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   204
  diff --git a/c.rb b/c.rb
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   205
  --- a/c.rb
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   206
  +++ b/c.rb
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   207
  @@ -1,4 +1,7 @@
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   208
   #!ruby
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   209
  +["foo", "bar", "baz"].map do |i|
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   210
  +  i
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   211
  +end
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   212
   ["foo", "bar", "baz"].map do |i|
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   213
     i.upcase
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   214
   end
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   215
  diff --git a/d.py b/d.py
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   216
  --- a/d.py
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   217
  +++ b/d.py
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   218
  @@ -2,6 +2,10 @@
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   219
       import foo
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   220
   except ImportError:
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   221
       pass
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   222
  +try:
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   223
  +    import baz
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   224
  +except ImportError:
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   225
  +    pass
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   226
   try:
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   227
       import bar
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   228
   except ImportError:
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   229
  diff --git a/functions.c b/functions.c
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   230
  --- a/functions.c
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   231
  +++ b/functions.c
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   232
  @@ -1,5 +1,10 @@
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   233
   1
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   234
   2
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   235
  +/* function */
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   236
  +bar() {
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   237
  +    foo
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   238
  +}
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   239
  +
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   240
   /* function */
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   241
   foo() {
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   242
       foo
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   243
  diff --git a/spaces.txt b/spaces.txt
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   244
  --- a/spaces.txt
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   245
  +++ b/spaces.txt
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   246
  @@ -2,6 +2,9 @@
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   247
   2
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   248
   a
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   249
   
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   250
  +b
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   251
  +a
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   252
  +
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   253
   b
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   254
   3
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   255
   4
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   256
#else
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   257
  $ hg diff --git
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   258
  diff --git a/a.c b/a.c
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   259
  --- a/a.c
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   260
  +++ b/a.c
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   261
  @@ -5,12 +5,6 @@
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   262
     return 1;
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   263
   }
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   264
   /*
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   265
  - * This function returns 2.
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   266
  - */
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   267
  -int g() {
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   268
  -  return 2;
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   269
  -}
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   270
  -/*
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   271
    * This function returns 3.
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   272
    */
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   273
   int h() {
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   274
  diff --git a/b.c b/b.c
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   275
  --- a/b.c
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   276
  +++ b/b.c
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   277
  @@ -3,5 +3,9 @@
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   278
   }
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   279
   
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   280
   if (y) {
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   281
  +   do_another_thing();
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   282
  +}
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   283
  +
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   284
  +if (y) {
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   285
      do_something_else();
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   286
   }
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   287
  diff --git a/c.rb b/c.rb
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   288
  --- a/c.rb
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   289
  +++ b/c.rb
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   290
  @@ -1,4 +1,7 @@
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   291
   #!ruby
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   292
   ["foo", "bar", "baz"].map do |i|
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   293
  +  i
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   294
  +end
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   295
  +["foo", "bar", "baz"].map do |i|
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   296
     i.upcase
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   297
   end
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   298
  diff --git a/d.py b/d.py
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   299
  --- a/d.py
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   300
  +++ b/d.py
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   301
  @@ -3,6 +3,10 @@
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   302
   except ImportError:
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   303
       pass
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   304
   try:
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   305
  +    import baz
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   306
  +except ImportError:
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   307
  +    pass
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   308
  +try:
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   309
       import bar
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   310
   except ImportError:
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   311
       pass
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   312
  diff --git a/functions.c b/functions.c
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   313
  --- a/functions.c
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   314
  +++ b/functions.c
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   315
  @@ -1,6 +1,11 @@
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   316
   1
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   317
   2
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   318
   /* function */
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   319
  +bar() {
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   320
  +    foo
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   321
  +}
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   322
  +
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   323
  +/* function */
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   324
   foo() {
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   325
       foo
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   326
   }
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   327
  diff --git a/spaces.txt b/spaces.txt
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   328
  --- a/spaces.txt
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   329
  +++ b/spaces.txt
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   330
  @@ -3,5 +3,8 @@
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   331
   a
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   332
   
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   333
   b
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   334
  +a
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   335
  +
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   336
  +b
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   337
   3
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   338
   4
7834927f0243 tests: add tests about diff quality
Jun Wu <quark@fb.com>
parents:
diff changeset
   339
#endif