Show More
@@ -35,6 +35,7 b' from . import (' | |||||
35 | mdiff, |
|
35 | mdiff, | |
36 | pathutil, |
|
36 | pathutil, | |
37 | scmutil, |
|
37 | scmutil, | |
|
38 | similar, | |||
38 | util, |
|
39 | util, | |
39 | ) |
|
40 | ) | |
40 | stringio = util.stringio |
|
41 | stringio = util.stringio | |
@@ -2521,6 +2522,9 b' def trydiff(repo, revs, ctx1, ctx2, modi' | |||||
2521 | header.append('old mode %s' % mode1) |
|
2522 | header.append('old mode %s' % mode1) | |
2522 | header.append('new mode %s' % mode2) |
|
2523 | header.append('new mode %s' % mode2) | |
2523 | if copyop is not None: |
|
2524 | if copyop is not None: | |
|
2525 | if opts.showsimilarity: | |||
|
2526 | sim = similar.score(ctx1[path1], ctx2[path2]) * 100 | |||
|
2527 | header.append('similarity index %d%%' % sim) | |||
2524 | header.append('%s from %s' % (copyop, path1)) |
|
2528 | header.append('%s from %s' % (copyop, path1)) | |
2525 | header.append('%s to %s' % (copyop, path2)) |
|
2529 | header.append('%s to %s' % (copyop, path2)) | |
2526 | elif revs and not repo.ui.quiet: |
|
2530 | elif revs and not repo.ui.quiet: |
@@ -229,6 +229,20 b' Git diff, adding space' | |||||
229 | -a |
|
229 | -a | |
230 | +b |
|
230 | +b | |
231 |
|
231 | |||
|
232 | Git diff, adding extended headers | |||
|
233 | ||||
|
234 | $ hg diff --git --config experimental.extendedheader.index=7 --config experimental.extendedheader.similarity=True | |||
|
235 | diff --git a/f1 b/f 1 | |||
|
236 | similarity index 0% | |||
|
237 | rename from f1 | |||
|
238 | rename to f 1 | |||
|
239 | index 7898192..6178079 100644 | |||
|
240 | --- a/f1 | |||
|
241 | +++ b/f 1 | |||
|
242 | @@ -1,1 +1,1 @@ | |||
|
243 | -a | |||
|
244 | +b | |||
|
245 | ||||
232 | Git diff with noprefix |
|
246 | Git diff with noprefix | |
233 |
|
247 | |||
234 | $ hg --config diff.noprefix=True diff --git --nodates |
|
248 | $ hg --config diff.noprefix=True diff --git --nodates |
General Comments 0
You need to be logged in to leave comments.
Login now