File: SetCurrentVersion.tcl

package info (click to toggle)
gcvs 1.0final-12
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 12,248 kB
  • ctags: 10,631
  • sloc: ansic: 71,709; cpp: 39,780; sh: 18,434; makefile: 1,915; yacc: 1,299; tcl: 1,283; perl: 910; lex: 249; csh: 185; lisp: 7
file content (39 lines) | stat: -rw-r--r-- 1,116 bytes parent folder | download | duplicates (3)
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
34
35
36
37
38
39
#!CVSGUI1.0 --selection --name "Copy to HEAD version"

# Author: Rafael Sanz <rafael_sanz@ya.com>

# This macro move your selected version to head revision
# For that:
# rename the file to temporal name
# update the head version
# set to edit mode
# delete the head version
# and rename the temporal file


set selList [cvsbrowser get]
set selSize [llength $selList]

cvsout "\n--- Files selected:  "
cvsout [clock format [clock seconds] -format "%a %m/%d/%y %H:%M:%S"] " ---\n"

for {set i 0} {$i < $selSize} {incr i} {
   set file [lindex $selList $i]

   cvsbrowser info $file fileInfo

   if { $fileInfo(missing) == 0 && $fileInfo(unknown) == 0 && $fileInfo(kind) == "file"} {

      cd $fileInfo(path)
      set tmpName tmp_$fileInfo(name)
      file copy -force  $fileInfo(name) $tmpName
      cvsout "Bringing file " $fileInfo(name) " based on revision " $fileInfo(revision) " to HEAD\n"
      cvs update -A $fileInfo(name)
      file copy -force  $tmpName $fileInfo(name)
      file delete $tmpName
      cvs edit $fileInfo(name)
   }
}

cvsout "----------------------------------------\n"
cvsout "(done)\n"