Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/patch.py @ 32235:15f10ee778f8
diff: draw a table about binary diff behaviors
The table should make it easier to reason about future changes.
author | Jun Wu <quark@fb.com> |
---|---|
date | Fri, 05 May 2017 16:48:58 -0700 |
parents | 776127b29a5c |
children | 0c67ab3d77d5 |
comparison
equal
deleted
inserted
replaced
32234:776127b29a5c | 32235:15f10ee778f8 |
---|---|
2582 header.append('%s from %s' % (copyop, path1)) | 2582 header.append('%s from %s' % (copyop, path1)) |
2583 header.append('%s to %s' % (copyop, path2)) | 2583 header.append('%s to %s' % (copyop, path2)) |
2584 elif revs and not repo.ui.quiet: | 2584 elif revs and not repo.ui.quiet: |
2585 header.append(diffline(path1, revs)) | 2585 header.append(diffline(path1, revs)) |
2586 | 2586 |
2587 # fctx.is | diffopts | what to | is fctx.data() | |
2588 # binary() | text nobinary git index | output? | outputted? | |
2589 # ------------------------------------|---------------------------- | |
2590 # yes | no no no * | summary | no | |
2591 # yes | no no yes * | base85 | yes | |
2592 # yes | no yes no * | summary | no | |
2593 # yes | no yes yes 0 | summary | no | |
2594 # yes | no yes yes >0 | summary | semi [1] | |
2595 # yes | yes * * * | text diff | yes | |
2596 # no | * * * * | text diff | yes | |
2597 # [1]: hash(fctx.data()) is outputted. so fctx.data() cannot be faked | |
2587 if binary and opts.git and not opts.nobinary and not opts.text: | 2598 if binary and opts.git and not opts.nobinary and not opts.text: |
2588 text = mdiff.b85diff(content1, content2) | 2599 text = mdiff.b85diff(content1, content2) |
2589 if text: | 2600 if text: |
2590 header.append('index %s..%s' % | 2601 header.append('index %s..%s' % |
2591 (gitindex(content1), gitindex(content2))) | 2602 (gitindex(content1), gitindex(content2))) |