The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Puppet::VcsTools::File - Tk GUI for VCS file management

SYNOPSIS

 use Tk ;
 use Puppet::VcsTools::File;
 use Puppet::VcsTools::HistEdit;
 use VcsTools::LogParser ;
 use VcsTools::DataSpec::HpTnd qw($description readHook);
 use Fcntl ;
 use MLDBM qw(DB_File);

 my %dbhash;
 tie %dbhash,  'MLDBM',    $file , O_CREAT|O_RDWR, 0640 or die $! ;

 my $ds = new VcsTools::LogParser
  (
   description => $description,
   readHook => \&readHook
  ) ;

 my $mw = MainWindow-> new ;
 $mw->withdraw ;

 my $he = $mw->LogEditor( 'format' => $ds) ;

 my $fileO = new Puppet::VcsTools::File 
  (
   dbHash => \%dbhash,
   keyRoot => 'root',
   vcsClass => 'VcsTools::HmsAgent',
   vcsArgs => 
   {
    hmsHost => 'hptnofs',
    hmsBase => 'test_integ'
    },
   name => $tfile,
   workDir => $ENV{'PWD'},
   dataScanner => $ds,
   logEditor => $he,
   'topTk' => $mw
  );

 $fileO -> display( master => 1);

 MainLoop ;

DESCRIPTION

This class provides a GUI to the VcsTools::File class.

The widget provides all the functionnalities to edit, archive, lock, unlock, change the mode of a file.

The widget also provide an 'open history' menu to call the Puppet::VcsTools::History widget which will let you work on the history of a file. Moreover, this widget will let you edit the log a each version of a file, if you want to modify it.

CAVEATS

The file must contain the $Revision: 1.3 $ VCS keyword.

WIDGET USAGE

The File widget contains a sub-window featuring:

  • A revision label to indicate the revision of the current file.

  • A 'writable' check button, which indicated the status of the file and is able to change its mode.

  • A 'locked'check button, which indicated the lock status of the file and is able to change its lock.

By default, all these menus and buttons are disabled until the user performs a File->check through the menu.

The File menu contains several commands :

  • open history: Will open the history menu.

  • check: to get the revision, mode, and lock status of the current file.

  • archive: to archive the file (Enabled only if the file is writable).

  • create archive: to create an archive of the file (Enabled only if the file is writable and the archive does not exist).

  • edit: to edit the file (Enabled only if the file is writable or if the file does not yet exist).

The File object will add some functionnalities to the History object while opening it :

  • A 'merge' global menu: To perform a merge on 2 selected revision.

  • A 'show diff' global menu: To show a diff between 2 selected revision.

  • Button 2 is bound to arrows to show the diff between the 2 revisions next to the arrow.

  • A 'show diff' command is also added to the arrow popup menu.

  • Button 2 is bound to nodes to show the content of this revision.

  • An 'edit log' entry is added to the popup menu of the nodes and arrows.

Constructor

new(...)

Will create a new File object.

Parameters are those of "new(...)" in VcsTools::File. plus :

  • topTk : Tk top window reference.

Generic methods

See "check()" in VcsTools::File

display()

Will launch a widget for this object.

archiveFile(...)

See "archiveFile(...)" in VcsTools::File.

Feature one more parameter : The user may pass a 'auto' parameter set to 1 if an interactive archive is not desired. (default 0)

History handling methods

See "createHistory()" in VcsTools::File, "edit()" in VcsTools::File "getRevision()" in VcsTools::File, "checkWritable()" in VcsTools::File, "chmodFile(...)" in VcsTools::File, "writeFile(...)" in VcsTools::File

openHistory()

Will create a Puppet::VcsTools::History object for this file and open its display.

Handling the real file

See "createLocalAgent()" in VcsTools::File, "edit()" in VcsTools::File, "getRevision()" in VcsTools::File, "checkWritable()" in VcsTools::File, "chmodFile(...)" in VcsTools::File, "writeFile(...)" in VcsTools::File

Handling the VCS part

See "createVcsAgent()" in VcsTools::File, "checkArchive()" in VcsTools::File, "changeLock(...)" in VcsTools::File, "checkOut(...)" in VcsTools::File, "getContent(...)" in VcsTools::File, "archiveLog(...)" in VcsTools::File, "getHistory()" in VcsTools::File, "showDiff(...)" in VcsTools::File, "checkIn(...)" in VcsTools::File

merge(...)

Will open a GUI to merge the 2 revisions. Will use xemacs ediff merge to perform the actual merge.

Parameters are :

  • rev1 : one of the revisions to merge.

  • rev2: the other.

The ancestor of rev1 and rev2 will be computed by the VcsTools::History object.

AUTHOR

Dominique Dumont, Dominique_Dumont@grenoble.hp.com

Copyright (c) 1998 Dominique Dumont. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO

perl(1), Tk(3), Puppet::Any(3), VcsTools::DataSpec::HpTnd(3), VcsTools::Version(3), VcsTools::File(3)