##// END OF EJS Templates
merge with stable
Augie Fackler -
r35470:78628942 merge default
parent child Browse files
Show More
@@ -1515,7 +1515,7 b' def diffordiffstat(ui, repo, diffopts, n'
1515 match.uipath(matchroot), uirelroot))
1515 match.uipath(matchroot), uirelroot))
1516
1516
1517 if stat:
1517 if stat:
1518 diffopts = diffopts.copy(context=0)
1518 diffopts = diffopts.copy(context=0, noprefix=False)
1519 width = 80
1519 width = 80
1520 if not ui.plain():
1520 if not ui.plain():
1521 width = ui.termwidth()
1521 width = ui.termwidth()
@@ -2223,10 +2223,12 b' def debugssl(ui, repo, source=None, **op'
2223 url = util.url(source)
2223 url = util.url(source)
2224 addr = None
2224 addr = None
2225
2225
2226 if url.scheme == 'https':
2226 defaultport = {'https': 443, 'ssh': 22}
2227 addr = (url.host, url.port or 443)
2227 if url.scheme in defaultport:
2228 elif url.scheme == 'ssh':
2228 try:
2229 addr = (url.host, url.port or 22)
2229 addr = (url.host, int(url.port or defaultport[url.scheme]))
2230 except ValueError:
2231 raise error.Abort(_("malformed port number in URL"))
2230 else:
2232 else:
2231 raise error.Abort(_("only https and ssh connections are supported"))
2233 raise error.Abort(_("only https and ssh connections are supported"))
2232
2234
@@ -547,7 +547,8 b' def compare(tmpl, context, leftlines, ri'
547 def diffstatgen(ctx, basectx):
547 def diffstatgen(ctx, basectx):
548 '''Generator function that provides the diffstat data.'''
548 '''Generator function that provides the diffstat data.'''
549
549
550 stats = patch.diffstatdata(util.iterlines(ctx.diff(basectx)))
550 stats = patch.diffstatdata(
551 util.iterlines(ctx.diff(basectx, noprefix=False)))
551 maxname, maxtotal, addtotal, removetotal, binary = patch.diffstatsum(stats)
552 maxname, maxtotal, addtotal, removetotal, binary = patch.diffstatsum(stats)
552 while True:
553 while True:
553 yield stats, maxname, maxtotal, addtotal, removetotal, binary
554 yield stats, maxname, maxtotal, addtotal, removetotal, binary
@@ -69,6 +69,57 b' Filename with spaces git diffstat:'
69 file with spaces | Bin
69 file with spaces | Bin
70 1 files changed, 0 insertions(+), 0 deletions(-)
70 1 files changed, 0 insertions(+), 0 deletions(-)
71
71
72 Filename without "a/" or "b/" (issue5759):
73
74 $ hg diff --config 'diff.noprefix=1' -c1 --stat --git
75 a | 3 +++
76 1 files changed, 3 insertions(+), 0 deletions(-)
77 $ hg diff --config 'diff.noprefix=1' -c2 --stat --git
78 c | Bin
79 d | 0
80 2 files changed, 0 insertions(+), 0 deletions(-)
81
82 $ hg log --config 'diff.noprefix=1' -r '1:' -p --stat --git
83 changeset: 1:3a95b07bb77f
84 user: test
85 date: Thu Jan 01 00:00:00 1970 +0000
86 summary: appenda
87
88 a | 3 +++
89 1 files changed, 3 insertions(+), 0 deletions(-)
90
91 diff --git a a
92 --- a
93 +++ a
94 @@ -211,3 +211,6 @@
95 a
96 a
97 a
98 +a
99 +a
100 +a
101
102 changeset: 2:c60a6c753773
103 tag: tip
104 user: test
105 date: Thu Jan 01 00:00:00 1970 +0000
106 summary: createb
107
108 c | Bin
109 d | 0
110 2 files changed, 0 insertions(+), 0 deletions(-)
111
112 diff --git c c
113 new file mode 100644
114 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..f76dd238ade08917e6712764a16a22005a50573d
115 GIT binary patch
116 literal 1
117 Ic${MZ000310RR91
118
119 diff --git d d
120 new file mode 100644
121
122
72 diffstat within directories:
123 diffstat within directories:
73
124
74 $ hg rm -f 'file with spaces'
125 $ hg rm -f 'file with spaces'
@@ -306,6 +306,23 b' diff removed file'
306 </html>
306 </html>
307
307
308
308
309 set up hgweb with git diffs + noprefix
310
311 $ killdaemons.py
312 $ hg serve --config 'diff.git=1' --config 'diff.noprefix=1' -p $HGPORT -d \
313 > --pid-file=hg.pid -A access.log -E errors.log
314 $ cat hg.pid >> $DAEMON_PIDS
315
316 patch header and diffstat
317
318 $ get-with-headers.py localhost:$HGPORT 'rev/0' \
319 > | egrep 'files changed|---|\+\+\+'
320 2 files changed, 2 insertions(+), 0 deletions(-)
321 <span id="l1.2" class="minusline">--- /dev/null</span><a href="#l1.2"></a>
322 <span id="l1.3" class="plusline">+++ a</span><a href="#l1.3"></a>
323 <span id="l2.2" class="minusline">--- /dev/null</span><a href="#l2.2"></a>
324 <span id="l2.3" class="plusline">+++ b</span><a href="#l2.3"></a>
325
309 set up hgweb with git diffs
326 set up hgweb with git diffs
310
327
311 $ killdaemons.py
328 $ killdaemons.py
General Comments 0
You need to be logged in to leave comments. Login now