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