Show More
@@ -100,7 +100,7 b' to allow selection of commits to be disp' | |||
|
100 | 100 | set ids [string range $cmit 0 [expr {$j - 1}]] |
|
101 | 101 | set ok 1 |
|
102 | 102 | foreach id $ids { |
|
103 |
if {![regexp {^[0-9a-f]{ |
|
|
103 | if {![regexp {^[0-9a-f]{12}$} $id]} { | |
|
104 | 104 | set ok 0 |
|
105 | 105 | break |
|
106 | 106 | } |
@@ -261,7 +261,7 b' proc readotherrefs {base dname excl} {' | |||
|
261 | 261 | catch { |
|
262 | 262 | set fd [open $f r] |
|
263 | 263 | set line [read $fd 40] |
|
264 |
if {[regexp {^[0-9a-f]{ |
|
|
264 | if {[regexp {^[0-9a-f]{12}} $line id]} { | |
|
265 | 265 | set name "$dname[file tail $f]" |
|
266 | 266 | set otherrefids($name) $id |
|
267 | 267 | lappend idotherrefs($id) $name |
@@ -1743,7 +1743,7 b' proc readfindproc {} {' | |||
|
1743 | 1743 | } |
|
1744 | 1744 | return |
|
1745 | 1745 | } |
|
1746 |
if {![regexp {^[0-9a-f]{ |
|
|
1746 | if {![regexp {^[0-9a-f]{12}} $line id]} { | |
|
1747 | 1747 | error_popup "Can't parse git-diff-tree output: $line" |
|
1748 | 1748 | stopfindproc |
|
1749 | 1749 | return |
@@ -1856,7 +1856,7 b' proc readfilediffs {df} {' | |||
|
1856 | 1856 | } |
|
1857 | 1857 | return |
|
1858 | 1858 | } |
|
1859 |
if {[regexp {^([0-9a-f]{ |
|
|
1859 | if {[regexp {^([0-9a-f]{12}) \(from ([0-9a-f]{12})\)} $line match id p]} { | |
|
1860 | 1860 | # start of a new string of diffs |
|
1861 | 1861 | donefilediff |
|
1862 | 1862 | set fdiffids [list $id $p] |
@@ -2014,7 +2014,7 b' proc appendwithlinks {text} {' | |||
|
2014 | 2014 | set start [$ctext index "end - 1c"] |
|
2015 | 2015 | $ctext insert end $text |
|
2016 | 2016 | $ctext insert end "\n" |
|
2017 |
set links [regexp -indices -all -inline {[0-9a-f]{ |
|
|
2017 | set links [regexp -indices -all -inline {[0-9a-f]{12}} $text] | |
|
2018 | 2018 | foreach l $links { |
|
2019 | 2019 | set s [lindex $l 0] |
|
2020 | 2020 | set e [lindex $l 1] |
@@ -87,12 +87,17 b' def difftree(ui, repo, node1=None, node2' | |||
|
87 | 87 | |
|
88 | 88 | for f in modified: |
|
89 | 89 | # TODO get file permissions |
|
90 |
print ":100664 100664 %s %s M\t%s\t%s" % (hg. |
|
|
91 |
hg. |
|
|
90 | print ":100664 100664 %s %s M\t%s\t%s" % (hg.short(mmap[f]), | |
|
91 | hg.short(mmap2[f]), | |
|
92 | f, f) | |
|
92 | 93 | for f in added: |
|
93 |
print ":000000 100664 %s %s N\t%s\t%s" % (empty, |
|
|
94 | print ":000000 100664 %s %s N\t%s\t%s" % (empty, | |
|
95 | hg.short(mmap2[f]), | |
|
96 | f, f) | |
|
94 | 97 | for f in removed: |
|
95 |
print ":100664 000000 %s %s D\t%s\t%s" % (hg. |
|
|
98 | print ":100664 000000 %s %s D\t%s\t%s" % (hg.short(mmap[f]), | |
|
99 | empty, | |
|
100 | f, f) | |
|
96 | 101 | ## |
|
97 | 102 | |
|
98 | 103 | while True: |
@@ -124,11 +129,11 b' def difftree(ui, repo, node1=None, node2' | |||
|
124 | 129 | def catcommit(repo, n, prefix, changes=None): |
|
125 | 130 | nlprefix = '\n' + prefix; |
|
126 | 131 | (p1, p2) = repo.changelog.parents(n) |
|
127 |
(h, h1, h2) = map(hg. |
|
|
132 | (h, h1, h2) = map(hg.short, (n, p1, p2)) | |
|
128 | 133 | (i1, i2) = map(repo.changelog.rev, (p1, p2)) |
|
129 | 134 | if not changes: |
|
130 | 135 | changes = repo.changelog.read(n) |
|
131 |
print "tree %s" % (hg. |
|
|
136 | print "tree %s" % (hg.short(changes[0])) | |
|
132 | 137 | if i1 != -1: print "parent %s" % (h1) |
|
133 | 138 | if i2 != -1: print "parent %s" % (h2) |
|
134 | 139 | date_ar = changes[2] |
@@ -154,7 +159,7 b' def base(ui, repo, node1, node2):' | |||
|
154 | 159 | node1 = repo.lookup(node1) |
|
155 | 160 | node2 = repo.lookup(node2) |
|
156 | 161 | n = repo.changelog.ancestor(node1, node2) |
|
157 |
print hg. |
|
|
162 | print hg.short(n) | |
|
158 | 163 | |
|
159 | 164 | def catfile(ui, repo, type=None, r=None, **opts): |
|
160 | 165 | """cat a specific revision""" |
@@ -276,17 +281,17 b' def revtree(args, repo, full="tree", max' | |||
|
276 | 281 | if parents: |
|
277 | 282 | pp = repo.changelog.parents(n) |
|
278 | 283 | if pp[0] != hg.nullid: |
|
279 |
parentstr += " " + hg. |
|
|
284 | parentstr += " " + hg.short(pp[0]) | |
|
280 | 285 | if pp[1] != hg.nullid: |
|
281 |
parentstr += " " + hg. |
|
|
286 | parentstr += " " + hg.short(pp[1]) | |
|
282 | 287 | if not full: |
|
283 |
print hg. |
|
|
288 | print hg.short(n) + parentstr | |
|
284 | 289 | elif full is "commit": |
|
285 |
print hg. |
|
|
290 | print hg.short(n) + parentstr | |
|
286 | 291 | catcommit(repo, n, ' ', changes) |
|
287 | 292 | else: |
|
288 | 293 | (p1, p2) = repo.changelog.parents(n) |
|
289 |
(h, h1, h2) = map(hg. |
|
|
294 | (h, h1, h2) = map(hg.short, (n, p1, p2)) | |
|
290 | 295 | (i1, i2) = map(repo.changelog.rev, (p1, p2)) |
|
291 | 296 | |
|
292 | 297 | date = changes[2][0] |
General Comments 0
You need to be logged in to leave comments.
Login now