Eskil

Check-in [38a2c9009a]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Support for Bazaar.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 38a2c9009a4fc325fe2ed8a856ad032ac03fd1f5
User & Date: peter 2008-03-05 18:43:01.000
Context
2008-03-05
18:43
Cannot wrap ttk::entry in the way it was done. check-in: e2d6d6fd24 user: peter tags: trunk
18:43
Support for Bazaar. check-in: 38a2c9009a user: peter tags: trunk
2008-03-04
07:21
More ttk adjustments. check-in: 9ebd7c4f7f user: peter tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to Changes.



1
2
3
4
5
6
7



2008-02-07
 Support for Mercurial.

2008-02-06
 Fixed a bug in patch view. A change last in patch was missed.

2008-01-23
>
>
>







1
2
3
4
5
6
7
8
9
10
2008-03-05
 Support for Bazaar.

2008-02-07
 Support for Mercurial.

2008-02-06
 Fixed a bug in patch view. A change last in patch was missed.

2008-01-23
Changes to doc/revision.txt.
1
2

3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
Eskil can compare versions in revision control systems.
Currently RCS, CVS, Git, Mercurial, Subversion and ClearCase are supported.


If you specify only one file on the command line to Eskil, it will automatically detect if the file is under revision control and enter revision control mode.

By default the local file is compared against the latest checked in version.  This is for the common case when you just want to know what you have changed before checking in.

You can use the -r option to select which version to compare.  It works like it does in "cvs diff".  Examples:

<pre>eskil file.txt</pre>
  Compare file.txt with the latest checked in version.
<pre>eskil -r rev file.txt</pre>
  Compare file.txt with the specified version.
<pre>eskil -r rev1 -r rev2 file.txt</pre>
  Compare the two revisions. This does not involve the local copy of file.txt.

The -r options are also available in the GUI in the "Rev 1" and "Rev 2" fields.

<ul>Commit support</ul>

When comparing a file with the latest checked in version, some of the systems have support for committing directly from Eskil.  If supported, the Commit button will be enabled.

<ul>Priority between systems</ul>

If multiple systems are used within a directory Git/Hg will be detected before CVS/SVN.  Command line options -cvs and -svn can be used to put preference on one of those systems.

<ul>Pipe a patch</ul>

Eskil can read a patch from standard input, thus allowing display from any patch generating command. Examples:
<pre>hg diff | eskil -</pre>
<pre>git diff -p --diff-filter=M master | eskil -</pre>


|
>





|
















|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
Eskil can compare versions in revision control systems.
Currently RCS, CVS, Git, Mercurial, Bazaar, Subversion and ClearCase
are supported.

If you specify only one file on the command line to Eskil, it will automatically detect if the file is under revision control and enter revision control mode.

By default the local file is compared against the latest checked in version.  This is for the common case when you just want to know what you have changed before checking in.

You can use the -r option to select which versions to compare.  It works like it does in "cvs diff".  Examples:

<pre>eskil file.txt</pre>
  Compare file.txt with the latest checked in version.
<pre>eskil -r rev file.txt</pre>
  Compare file.txt with the specified version.
<pre>eskil -r rev1 -r rev2 file.txt</pre>
  Compare the two revisions. This does not involve the local copy of file.txt.

The -r options are also available in the GUI in the "Rev 1" and "Rev 2" fields.

<ul>Commit support</ul>

When comparing a file with the latest checked in version, some of the systems have support for committing directly from Eskil.  If supported, the Commit button will be enabled.

<ul>Priority between systems</ul>

If multiple systems are used within a directory Git/Hg/Bzr will be detected before CVS/SVN.  Command line options -cvs and -svn can be used to put preference on one of those systems.

<ul>Pipe a patch</ul>

Eskil can read a patch from standard input, thus allowing display from any patch generating command. Examples:
<pre>hg diff | eskil -</pre>
<pre>git diff -p --diff-filter=M master | eskil -</pre>

43
44
45
46
47
48
49




50
51
52
53
54
55
56

Git currently only supports "HEAD" and "master" as -r options.

<ul>Mercurial</ul>

For Mercurial -r works as in "hg cat -r".





<ul>ClearCase</ul>

ClearCase has more complex version "numbers".
ClearCase stream names are built like file paths and in -r you can access the streams similar to how you find files.
Your current stream is the "current directory".
A negative version number is offset from latest.
<pre>-r 5                    </pre>: Version 5 in current stream.







>
>
>
>







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61

Git currently only supports "HEAD" and "master" as -r options.

<ul>Mercurial</ul>

For Mercurial -r works as in "hg cat -r".

<ul>Bazaar</ul>

For Bazaar -r works as in "bzr cat -r".

<ul>ClearCase</ul>

ClearCase has more complex version "numbers".
ClearCase stream names are built like file paths and in -r you can access the streams similar to how you find files.
Your current stream is the "current directory".
A negative version number is offset from latest.
<pre>-r 5                    </pre>: Version 5 in current stream.
Changes to src/rev.tcl.
47
48
49
50
51
52
53

54
55
56
57
58
59
60

namespace eval eskil::rev::CVS {}
namespace eval eskil::rev::RCS {}
namespace eval eskil::rev::CT {}
namespace eval eskil::rev::GIT {}
namespace eval eskil::rev::SVN {}
namespace eval eskil::rev::HG {}


proc eskil::rev::CVS::detect {file} {
    set dir [file dirname $file]
    if {[file isdirectory [file join $dir CVS]]} {
        if {[auto_execok cvs] ne ""} {
            return 1
        }







>







47
48
49
50
51
52
53
54
55
56
57
58
59
60
61

namespace eval eskil::rev::CVS {}
namespace eval eskil::rev::RCS {}
namespace eval eskil::rev::CT {}
namespace eval eskil::rev::GIT {}
namespace eval eskil::rev::SVN {}
namespace eval eskil::rev::HG {}
namespace eval eskil::rev::BZR {}

proc eskil::rev::CVS::detect {file} {
    set dir [file dirname $file]
    if {[file isdirectory [file join $dir CVS]]} {
        if {[auto_execok cvs] ne ""} {
            return 1
        }
77
78
79
80
81
82
83













84
85
86
87
88
89
90
    # HG, detect two steps down. Could be improved. FIXA
    if {[file isdirectory [file join $dir .hg]] ||
        [file isdirectory [file join $dir .. .hg]] ||
        [file isdirectory [file join $dir .. .. .hg]]} {
        if {[auto_execok hg] ne ""} {
            return 1
        }













    }
    return 0
}

proc eskil::rev::RCS::detect {file} {
    set dir [file dirname $file]
    if {[file isdirectory [file join $dir RCS]] || [file exists $file,v]} {







>
>
>
>
>
>
>
>
>
>
>
>
>







78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
    # HG, detect two steps down. Could be improved. FIXA
    if {[file isdirectory [file join $dir .hg]] ||
        [file isdirectory [file join $dir .. .hg]] ||
        [file isdirectory [file join $dir .. .. .hg]]} {
        if {[auto_execok hg] ne ""} {
            return 1
        }
    }
    return 0
}

proc eskil::rev::BZR::detect {file} {
    set dir [file dirname $file]
    # HG, detect two steps down. Could be improved. FIXA
    if {[file isdirectory [file join $dir .bzr]] ||
        [file isdirectory [file join $dir .. .bzr]] ||
        [file isdirectory [file join $dir .. .. .bzr]]} {
        if {[auto_execok bzr] ne ""} {
            return 1
        }
    }
    return 0
}

proc eskil::rev::RCS::detect {file} {
    set dir [file dirname $file]
    if {[file isdirectory [file join $dir RCS]] || [file exists $file,v]} {
198
199
200
201
202
203
204



























205
206
207
208
209
210
211
        }
    }

    if {$old != ""} {
        cd $old
    }
}




























# Get an RCS revision
proc eskil::rev::RCS::get {filename outfile {rev {}}} {
    catch {exec co -p$rev [file nativename $filename] \
            > $outfile}
}








>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
        }
    }

    if {$old != ""} {
        cd $old
    }
}

# Get a BZR revision
proc eskil::rev::BZR::get {filename outfile rev} {
    set old ""
    set dir [file dirname $filename]
    if {$dir != "."} {
        set old [pwd]
        set outfile [file join [pwd] $outfile]
        cd $dir
        set filename [file tail $filename]
    }

    set cmd [list exec bzr cat]
    if {$rev != ""} {
        lappend cmd -r $rev
    }
    lappend cmd [file nativename $filename] > $outfile
    if {[catch {eval $cmd} res]} {
        if {$res ne ""} {
            tk_messageBox -icon error -title "BZR error" -message $res
        }
    }

    if {$old != ""} {
        cd $old
    }
}

# Get an RCS revision
proc eskil::rev::RCS::get {filename outfile {rev {}}} {
    catch {exec co -p$rev [file nativename $filename] \
            > $outfile}
}

308
309
310
311
312
313
314










315
316
317
318
319
320
321
    }
    return $result
}

# Figure out HG revision from arguments
proc eskil::rev::HG::ParseRevs {filename revs} {
    set result ""










    foreach rev $revs {
        # No parsing yet...
        lappend result $rev
    }
    return $result
}








>
>
>
>
>
>
>
>
>
>







349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
    }
    return $result
}

# Figure out HG revision from arguments
proc eskil::rev::HG::ParseRevs {filename revs} {
    set result ""
    foreach rev $revs {
        # No parsing yet...
        lappend result $rev
    }
    return $result
}

# Figure out BZR revision from arguments
proc eskil::rev::BZR::ParseRevs {filename revs} {
    set result ""
    foreach rev $revs {
        # No parsing yet...
        lappend result $rev
    }
    return $result
}

444
445
446
447
448
449
450
451
452
453
454
455
456
457
458

    if {![file exists $file]} { return "" }

    if {[info exists cache($file)]} {
        return $cache($file)
    }
    
    set searchlist [list $preference GIT HG]
    foreach ns [namespace children eskil::rev] {
        lappend searchlist [namespace tail $ns]
    }
    foreach rev $searchlist {
        set result [eskil::rev::${rev}::detect $file]
        if {$result} {
            set cache($file) $rev







|







495
496
497
498
499
500
501
502
503
504
505
506
507
508
509

    if {![file exists $file]} { return "" }

    if {[info exists cache($file)]} {
        return $cache($file)
    }
    
    set searchlist [list $preference GIT HG BZR]
    foreach ns [namespace children eskil::rev] {
        lappend searchlist [namespace tail $ns]
    }
    foreach rev $searchlist {
        set result [eskil::rev::${rev}::detect $file]
        if {$result} {
            set cache($file) $rev
Changes to tests/rev.test.
226
227
228
229
230
231
232


















    if {!$apa} {
        file delete .svn
    }
    set res
} -cleanup {
    tcltest::removeFile {} _rev2_10
} -result {SVN}

























>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
    if {!$apa} {
        file delete .svn
    }
    set res
} -cleanup {
    tcltest::removeFile {} _rev2_10
} -result {SVN}

test rev-2.11 {
    Detecting, BZR
} -body {
    set f [tcltest::makeFile {} _rev2_11]
    set ::auto_execs(bzr) "x"
    set apa [file isdirectory .bzr]
    if {!$apa} {
        file mkdir .bzr
    }
    set res [detectRevSystem $f]
    if {!$apa} {
        file delete .bzr
    }
    set res
} -cleanup {
    tcltest::removeFile {} _rev2_11
} -result {BZR}