︙ | | |
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
-
+
+
|
# eskil::rev::XXX::get {filename outfile rev}
#
# Get a revision of a file and place it in outfile.
# rev is in any format understood by this system, and
# should be retrieved from ParseRevs
# eskil::rev::XXX::getPatch {revs}
# eskil::rev::XXX::getPatch {revs {files {}}}
#
# Get a patch of the file tree, between the revisions given.
# revs is in any format understood by this system, and
# should be retrieved from ParseRevs
# An optional list of files that should be included can be given.
# eskil::rev::XXX::commitFile {top filename}
#
# If implemented, enables the commit feature when comparing an edited
# file agains latest check in.
# eskil::rev::XXX::viewLog {top filename revs}
|
︙ | | |
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
|
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
|
-
+
+
|
if {$old != ""} {
cd $old
}
}
# Get a CVS patch
proc eskil::rev::CVS::getPatch {revs} {
proc eskil::rev::CVS::getPatch {revs {files {}}} {
if {$::Pref(context) > 0} {
set context $::Pref(context)
} else {
set context 5
}
# TODO: support files
set cmd [list exec cvs diff -U $context]
foreach rev $revs {
lappend cmd -r $rev
}
if {[catch {eval $cmd} res]} {
if {![string match "*=========*" $res]} {
|
︙ | | |
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
|
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
|
-
+
+
|
if {$old != ""} {
cd $old
}
}
# Get a SVN patch
proc eskil::rev::SVN::getPatch {revs} {
proc eskil::rev::SVN::getPatch {revs {files {}}} {
# TODO: support files
set cmd [list exec svn diff]
foreach rev $revs {
lappend cmd -r $rev
}
if {[catch {eval $cmd} res]} {
tk_messageBox -icon error -title "SVN error" -message $res
|
︙ | | |
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
|
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
|
-
+
+
|
if {$old != ""} {
cd $old
}
}
# Get a HG patch
proc eskil::rev::HG::getPatch {revs} {
proc eskil::rev::HG::getPatch {revs {files {}}} {
# TODO: support files
set cmd [list exec hg diff]
foreach rev $revs {
lappend cmd -r $rev
}
if {[catch {eval $cmd} res]} {
tk_messageBox -icon error -title "HG error" -message $res
|
︙ | | |
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
|
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
|
-
+
+
|
if {$old != ""} {
cd $old
}
}
# Get a BZR patch
proc eskil::rev::BZR::getPatch {revs} {
proc eskil::rev::BZR::getPatch {revs {files {}}} {
# TODO: support files
set cmd [list exec bzr diff]
if {[llength $revs] == 2} {
lappend cmd -r [lindex $revs 0]..[lindex $revs 1]
} elseif {[llength $revs] == 1} {
lappend cmd -r [lindex $revs 0]
}
|
︙ | | |
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
|
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
|
-
+
|
# Get an RCS revision
proc eskil::rev::RCS::get {filename outfile {rev {}}} {
catch {exec co -p$rev [file nativename $filename] \
> $outfile}
}
# Get a RCS patch
proc eskil::rev::RCS::getPatch {revs} {
proc eskil::rev::RCS::getPatch {revs {files {}}} {
# Not supported yet.
return ""
}
# Get a GIT revision
# No support for revisions yet
proc eskil::rev::GIT::get {filename outfile rev} {
|
︙ | | |
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
|
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
|
-
-
+
+
|
}
cd $dir
catch {exec git add $tail}
cd $old
}
# Get a GIT patch
proc eskil::rev::GIT::getPatch {revs} {
set cmd [list exec git diff]
proc eskil::rev::GIT::getPatch {revs {files {}}} {
set cmd [list exec git diff {*}$files]
# No rev support yet
if {[catch {eval $cmd} res]} {
tk_messageBox -icon error -title "GIT error" -message $res
return ""
}
return $res
|
︙ | | |
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
|
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
|
-
+
+
-
+
|
} else {
catch {exec fossil finfo -p $tail -r $rev > $outfile}
}
cd $old
}
# Get a FOSSIL patch
proc eskil::rev::FOSSIL::getPatch {revs} {
proc eskil::rev::FOSSIL::getPatch {revs {files {}}} {
# TODO: support files
set cmd [list exec fossil diff]
# No rev support yet
if {[catch {eval $cmd} res]} {
tk_messageBox -icon error -title "FOSSIL error" -message $res
return ""
}
return $res
}
# Get a ClearCase revision
proc eskil::rev::CT::get {filename outfile rev} {
set filerev [file nativename $filename@@$rev]
if {[catch {exec cleartool get -to $outfile $filerev} msg]} {
tk_messageBox -icon error -title "Cleartool error" -message $msg
return
}
}
# Get a CT patch
proc eskil::rev::CT::getPatch {revs} {
proc eskil::rev::CT::getPatch {revs {files {}}} {
# Not supported yet
return ""
}
# Get a P4 revision
proc eskil::rev::P4::get {filename outfile rev} {
set dir [file dirname $filename]
|
︙ | | |
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
|
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
|
+
-
+
|
}
# Get a complete tree patch from this system.
proc getFullPatch {top} {
global Pref
set type $::diff($top,modetype)
set files $::diff($top,reviewFiles)
set revs {}
# Search for revision options
if {$::diff($top,doptrev1) != ""} {
lappend revs $::diff($top,doptrev1)
}
if {$::diff($top,doptrev2) != ""} {
lappend revs $::diff($top,doptrev2)
}
set revs [eskil::rev::${type}::ParseRevs "" $revs]
set revlabels {}
foreach rev $revs {
lappend revlabels [GetLastTwoPath $rev]
}
return [eskil::rev::${type}::getPatch $revs]
return [eskil::rev::${type}::getPatch $revs $files]
}
##############################################################################
# Utilities
##############################################################################
# Get the last two elements in a file path
|
︙ | | |