Fossil

Check-in [2740b48b]
Login

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

Overview
Comment:Cleaned up the creation of the workspace directory.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:2740b48b6323093e9abcb57e3bcc90d8dd503bac
User & Date: aku 2007-09-17 03:13:07
Context
2007-09-17
04:14
Fixed bug in the new code setting up the timeline, forgot to clean up loop state, causing data from previous iterations to bleed into the current one, causing the use of bogus data and ultimatively a bogus timeline. Note! Incidentially a bug in the old code was fixed by the new one, the use of mismatching revisions and commit messages. That caused the generation of extra changesets in the old code. check-in: 10e3b3ed user: aku tags: trunk
03:13
Cleaned up the creation of the workspace directory. check-in: 2740b48b user: aku tags: trunk
03:03
More structuring of the CVS backend, encapsulated the management of the global timeline of events in the project in a separate package. check-in: 1593006e user: aku tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to tools/lib/cvs.tcl.

66
67
68
69
70
71
72
73
74
75
76
77
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
...
221
222
223
224
225
226
227













228
229
230
231
232
233
234
...
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
...
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
...
534
535
536
537
538
539
540
541
542

543
544
545
546
547
548
549
550
551
    } {
	return 0
    }
    return 1
}

proc ::vc::cvs::ws::begin {src} {
    variable project

    set src [file normalize $src]
    if {![check $src msg]} { return -code error $msg }

    DefBase $src
    MakeTimeline [ScanArchives [files::find [RootPath]]]

    # OLD api calls ... TODO rework for more structure ...
    csets    ; # Group changes into sets
    rtree    ; # Build revision tree (trunk only right now).

    set w [workspace]   ; # OLD api ... TODO inline
    if {$project ne ""} {
	set w $w/$project
	file mkdir $w
    }
    return $w
}

proc ::vc::cvs::ws::done {} {
    variable cwd
    variable workspace
    cd $cwd
    file delete -force $workspace
    return
}

proc ::vc::cvs::ws::foreach {cv script} {
    # OLD api ... TODO inline
    uplevel 1 [list ::vc::cvs::ws::foreach_cset $cv 0 $script]
................................................................................

proc ::vc::cvs::ws::Operation {rev state} {
    if {$state eq "dead"} {return "R"} ; # Removed
    if {$rev   eq "1.1"}  {return "A"} ; # Added
    return "M"                         ; # Modified
}
















# Group single changes into changesets

proc ::vc::cvs::ws::csets {} {
    variable timeline
    variable csets
................................................................................
    # Tree holding trunk and branch information (struct::tree).
    # Node names are cset id's.

    variable rtree {}
    variable ntrunk 0
}

proc ::vc::cvs::ws::workspace {} {
    variable cwd [pwd]
    variable workspace [fileutil::tempfile importF_cvs_ws_]
    file delete $workspace
    file mkdir  $workspace

    write 0 cvs "Workspace:  $workspace"

    cd     $workspace ; # Checkouts go here.
    return $workspace
}

proc ::vc::cvs::ws::wssetup {c} {
    variable csets
    variable base
    variable project

    # pwd = workspace

................................................................................
	}
    }

    # Provide metadata about the changeset the backend may wish to have
    return [list $u $s $cm]
}

namespace eval ::vc::cvs::ws {
    # Workspace where checkouts happen
    # Current working directory to go back to after the import.

    variable workspace {}
    variable cwd       {}
}

proc ::vc::cvs::ws::foreach_cset {cv node script} {
    upvar 1 $cv c
    variable rtree

    set c $node
    while {1} {
	set code [catch {uplevel 1 $script} res]
................................................................................
    if {$plural eq ""} {set plural ${singular}s}
    return $plural
}

# -----------------------------------------------------------------------------

namespace eval ::vc::cvs::ws {
    variable base    {} ; # Toplevel repository directory
    variable project {} ; # Sub directory to limit the import to.


    namespace export configure begin done foreach ncsets checkout
}

# -----------------------------------------------------------------------------
# Ready

package provide vc::cvs::ws 1.0
return







<
<
<









<
<
<
<
<
|



|
<
<







 







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







 







<
<
<
<
<
<
<
<
<
<
<
<







 







<
<
<
<
<
<
<
<







 







|
|
>









66
67
68
69
70
71
72



73
74
75
76
77
78
79
80
81





82
83
84
85
86


87
88
89
90
91
92
93
...
211
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
...
314
315
316
317
318
319
320












321
322
323
324
325
326
327
...
382
383
384
385
386
387
388








389
390
391
392
393
394
395
...
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
    } {
	return 0
    }
    return 1
}

proc ::vc::cvs::ws::begin {src} {



    if {![check $src msg]} { return -code error $msg }

    DefBase $src
    MakeTimeline [ScanArchives [files::find [RootPath]]]

    # OLD api calls ... TODO rework for more structure ...
    csets    ; # Group changes into sets
    rtree    ; # Build revision tree (trunk only right now).






    return [MakeWorkspace]
}

proc ::vc::cvs::ws::done {} {
    variable            workspace


    file delete -force $workspace
    return
}

proc ::vc::cvs::ws::foreach {cv script} {
    # OLD api ... TODO inline
    uplevel 1 [list ::vc::cvs::ws::foreach_cset $cv 0 $script]
................................................................................

proc ::vc::cvs::ws::Operation {rev state} {
    if {$state eq "dead"} {return "R"} ; # Removed
    if {$rev   eq "1.1"}  {return "A"} ; # Added
    return "M"                         ; # Modified
}

proc ::vc::cvs::ws::MakeWorkspace {} {
    variable project
    variable workspace [fileutil::tempfile importF_cvs_ws_]

    set w $workspace
    if {$project ne ""} { append w /$project }

    file delete $workspace
    file mkdir  $w

    write 0 cvs "Workspace:  $workspace"
    return $w
}


# Group single changes into changesets

proc ::vc::cvs::ws::csets {} {
    variable timeline
    variable csets
................................................................................
    # Tree holding trunk and branch information (struct::tree).
    # Node names are cset id's.

    variable rtree {}
    variable ntrunk 0
}













proc ::vc::cvs::ws::wssetup {c} {
    variable csets
    variable base
    variable project

    # pwd = workspace

................................................................................
	}
    }

    # Provide metadata about the changeset the backend may wish to have
    return [list $u $s $cm]
}









proc ::vc::cvs::ws::foreach_cset {cv node script} {
    upvar 1 $cv c
    variable rtree

    set c $node
    while {1} {
	set code [catch {uplevel 1 $script} res]
................................................................................
    if {$plural eq ""} {set plural ${singular}s}
    return $plural
}

# -----------------------------------------------------------------------------

namespace eval ::vc::cvs::ws {
    variable base      {} ; # Toplevel repository directory
    variable project   {} ; # Sub directory to limit the import to.
    variable workspace {} ; # Directory to checkout changesets to.

    namespace export configure begin done foreach ncsets checkout
}

# -----------------------------------------------------------------------------
# Ready

package provide vc::cvs::ws 1.0
return