Topic: File Version Generator (Multi-BAK :-) ) (1 of 17), Read 72 times
Conf: VEDIT Macro Library
From: Christian Ziemski
Date: Saturday, November 02, 2002 06:22 AM

I wrote a little macro to make it possible to have more than one .BAK file.
That means: You can have an unlimited amount of versions of a file edited in VEDIT.
Of course it's not a full featured version-control-system...

You can set an option in the macro whether you want to use a timestamp or a version-number to make the saved file unique.

The version files are stored in a special directory (default name: "!versions") which is created as subdirectory in the current dir.

When the macro is executed it opens a dialog and you can:
-- Save the current file as new version (filename is automatically generated)
or
-- Load a previously saved (older) version.


(Due to the used Dialog_Input_1() command the macro only runs with the Windows version of VEDIT.)


Christian

PS: Outdated attachment deleted.

 


Topic: Re: File Version Generator (Multi-BAK :-) ) (2 of 17), Read 66 times
Conf: VEDIT Macro Library
From: Fritz Heberlein
Date: Tuesday, October 29, 2002 05:09 PM

Christian:

Effective version control is important in scientific publication as well.

An effective use of filevers.vdm would, however, presuppose a slight
modification, i.e. the opportunity to save the file in a format like
"file_001.tex". E.g., Tex and its "derivates" like latex, context, pdftex,
and maybe others that allow use of an external editor as well, require
the file to have the expected extension.

I would be glad if you could consider this as an option.

Anyway, i think the concept of version control should make its way
into the official vedit distribution some time.

Fritz

 


Topic: Re: File Version Generator (Multi-BAK :-) ) (3 of 17), Read 64 times
Conf: VEDIT Macro Library
From: Ted Green
Date: Sunday, October 27, 2002 01:08 PM

I am just going to follow this discussion for a while. I can see the benefits of multiple backup files. Perhaps I can implement one of the strategies discussed here in a future version of VEDIT.

Ted.

 


Topic: Re: File Version Generator (Multi-BAK :-) ) (13 of 17), Read 46 times
Conf: VEDIT Macro Library
From: Pauli Lindgren
Date: Wednesday, November 06, 2002 11:21 AM

On 10/27/2002 1:08:17 PM, Ted Green wrote:
>I am just going to follow this
>discussion for a while. I can
>see the benefits of multiple
>backup files. Perhaps I can
>implement one of the
>strategies discussed here in a
>future version of VEDIT.
>
>Ted.

Maybe you could have some limited number of backup files. For example, if user would choose to have 3 backup files for each file, then the last 3 backups would be kept, and the oldest would be removed.

BTW, in the eighties, I used VMS operating system for a while. VMS had unlimited number of backups. Every time you modified a file, a new version was created. The old versions were then deleted after certain period of time (which could be configured).
The filenames had a number added at the end. If you entered the filename without the number, the latest version was automatically used, but you could open any version by entering the filename with the number.


-- Pauli

 


Topic: Re: File Version Generator (Multi-BAK :-) ) (15 of 17), Read 45 times
Conf: VEDIT Macro Library
From: Ted Green
Date: Wednesday, November 06, 2002 03:14 PM

At 11:21 AM 11/6/2002, you wrote:
>Maybe you could have some limited number of backup files. For example, if user would choose to have 3 backup files for each file, then the last 3 backups would be kept, and the oldest would be removed.

Yes, I am thinking in those terms. However, it will have to wait until after 6.1 is released or I will never finish it.

Ted.

 


Topic: Re: File Version Generator (Multi-BAK :-) ) (16 of 17), Read 47 times
Conf: VEDIT Macro Library
From: Fritz Heberlein
Date: Wednesday, November 06, 2002 04:18 PM

> >Maybe you could have some limited number of backup files. For
> >example, if user would choose to have 3 backup files for each file,
> >then the last 3 backups would be kept, and the oldest would be
> >removed.
>
> Yes, I am thinking in those terms.

From the viewpoint of a linguist (and probably of other many other
disciplines as well) it is desirable to be able to document the
development process of an article / chapter as completely as possible.
This way you can see the way your thinking about a certain problem as
developed / shifted / gone in circles etc :).

Therefore I appreciate the present state of Christian's macro, which is,
as it is, a convenient tool of documentation.

Fritz
--
Dr. Friedrich Heberlein, Akad. Direktor
Seminar für Klassische Philologie der KU Eichstaett
Universitaetsallee 1
D-85071 Eichstaett / Bayern
email: sla019@...
Tel.: +49 8421 93 1544 / 93 3544

 


Topic: Re: File Version Generator (Multi-BAK :-) ) (4 of 17), Read 64 times
Conf: VEDIT Macro Library
From: Christian Ziemski
Date: Sunday, October 27, 2002 01:29 PM

Fritz:

You wrote:
>An effective use of filevers.vdm would, however, pressupose a slight
>modification, i.e. the opportunity to save the file in a format like
>"file_001.tex". E.g., Tex and its "derivates" like late, context, =pdftex,
>and maybe others that allow use of an external editor as well, require
>the file to have the expected extension.


Usual .bak files don't have the "correct" extension too.

The concept of versionizing I implemented works this way:

There is always only ONE active version of the file: "filename.ext".
The saved versions "filename.ext__nnn" are not active until one of
them is made active again explicetly by the macro (by copying it to
"filename.ext" again).

The saved file versions are never intended to be opened directly and
so they don't need the origin extension.

Your suggested way of creating versions is IMHO a completely different
one. I'm not sure whether I like it. Perhaps you can try to convince
me? ;-)


Christian

 


Topic: Re: File Version Generator (Multi-BAK :-) ) (5 of 17), Read 66 times
Conf: VEDIT Macro Library
From: Fritz Heberlein
Date: Sunday, October 27, 2002 03:03 PM

> Your suggested way of creating versions is IMHO a completely different
> one.

I'm not sure. The only material difference would be: "file_002.tex"
instead of "file.bak_002".

> The saved file versions are never intended to be opened directly.

I see. But why should we want exactly this? Just for one reason: to
look up a previous versions of some paper, we have to compile it
again ...

> until one of them is made active again explicetly by the macro (by
copying it to "filename.ext" again).

... without killing our immortal ideas of the past hours or days :)

Fritz

 


Topic: Re: File Version Generator (Multi-BAK :-) ) (6 of 17), Read 64 times
Conf: VEDIT Macro Library
From: Christian Ziemski
Date: Sunday, October 27, 2002 03:26 PM

>> The saved file versions are never intended to be opened directly.
>
>I see. But why should we want exactly this? Just for one reason: to
>look up a previous versions of some paper, we have to compile it
>again ...
>
>> until one of them is made active again explicetly by the macro (by
>copying it to "filename.ext" again).
>
>... without killing our immortal ideas of the past hours or days :)

Of course without that! The current document can be versionized just
before restoring an old one.


I see. We have different goals in mind.

I'll think over it.
It should be possible to combine both ways in the macro.


Christian

 


Topic: Re: File Version Generator (Multi-BAK :-) ) (7 of 17), Read 69 times
Conf: VEDIT Macro Library
From: Christian Ziemski
Date: Saturday, November 02, 2002 06:24 AM

Fritz,

I added your suggestion to the macro.

There is now a section "user changeable options" in the beginning of the macro to change the behavior.

(Due to time limitations not much tested.
Please be my beta tester ;-) )

Christian


PS: Outdated attachment deleted.

 


Topic: Re: File Version Generator (Multi-BAK :-) ) (8 of 17), Read 67 times
Conf: VEDIT Macro Library
From: Fritz Heberlein
Date: Tuesday, October 29, 2002 09:36 AM

> There is now a section "user changeable options" in the beginning of
> the macro to change the behaviour.

Christian,

thank you very much for this helpful modification. I will start using it
right away, and I'm sure that anybody struggeling with many different
versions of texts / files will realize its usefulness.
>
> (Due to time limitations not much tested.
> Please be my beta tester ;-) )

Seems that I'm the gamma oder delta tester: it works perfect for me.

Fritz

 


Topic: Re: File Version Generator (Multi-BAK :-) ) (9 of 17), Read 63 times
Conf: VEDIT Macro Library
From: Fritz Heberlein
Date: Thursday, October 31, 2002 11:52 AM

> You now can customize the macro via dialog.
> No more fiddling with the source code necessary.

Well, as the Greek philosophers would have said, apparently we are going now from the sphere of necessity into that of luxury.
And as always, people you have given a Beetle are looking out for the BMW to come:

So, why not add a button that invokes the compare macro for a convenient comparison of the "actual" file with the previous one?

Just in case you are in a very philanthropic mood over the weekend :)

Thanks and regards,
Fritz

 


Topic: Re: File Version Generator (Multi-BAK :-) ) (10 of 17), Read 63 times
Conf: VEDIT Macro Library
From: Christian Ziemski
Date: Thursday, October 31, 2002 04:52 PM

>And as always, people you have given a Beetle are looking out for
>the BMW to come:
>
>So, why not add a button that invokes the compare macro for a
>convenient comparison of the "actual" file with the previous one?


That has already been on my own wishlist.
But I'm not yet sure about the exact way what to compare with what.

Another planned feature is a "remove doubles" to find and delete files
with different version numbers but the same contents.


Christian

 


Topic: Re: File Version Generator (Multi-BAK :-) ) (12 of 17), Read 50 times
Conf: VEDIT Macro Library
From: Pauli Lindgren
Date: Wednesday, November 06, 2002 11:06 AM

On the other hand, RCS revision control system is free, and it is a full featured version control system.

You can download RCS support for Vedit from my page
http://koti.mbnet.fi/pkl/rcs.htm

This package contains:
- automatic check-in and check-out using event macros
- revision history
- file compare using RcsDiff
- syntax highlight for RcsDiff
- function to jump from RcsDiff to correct location in the file

Of course, you can do a lots of other things by giving commands to RCS from DOS prompt.

However, I have not updated my Vedit pages for a while. I should do it in near future. But the RCS macros have not changed much.

-- Pauli

 


Topic: Re: File Version Generator (Multi-BAK :-) ) (14 of 17), Read 49 times
Conf: VEDIT Macro Library
From: Christian Ziemski
Date: Wednesday, November 06, 2002 01:47 PM

On 11/6/2002 11:06:54 AM, Pauli Lindgren wrote:
>On the other hand, RCS revision control system is
>free, and it is a full featured version control
>system.

Yes, but RCS and relatives may be a bit too big for some users. It requires additional installation steps and maintenance. It's o.k. for developers but not for standard users. IMHO.


Christian

 


Topic: File Version Generator (Multi-BAK :-) ) (11 of 17), Read 68 times
Conf: VEDIT Macro Library
From: Christian Ziemski
Date: Saturday, November 23, 2002 05:03 PM



After that many messages about new versions and features I decided to summarize them here.
(And I'll delete some of my unnecessary messages then.)



The macro FILEVERS.VDM is something like a file-version-maintaining tool.
So you can have more than one .BAK file.

That means: You can have an unlimited amount of versions of a file edited in VEDIT.
(Of course it's not a full featured version-control-system...)


When the macro is executed it opens a dialog and you can:

- Save the current file as new version (name generated automatically)
- Load an old version of the currently loaded file
- Delete an old versions of the file
- Compare current file with an old version (in a second instance of VEDIT)
- Customize the behavior via dialog (No manual fiddling with the source code necessary) The changes are saved automatically in the macro itself.


The way old versions are made unique in filename can be set up in the "Customize" dialog:

- filename.ext__nnn
- filename__nnn.ext
- filename.ext__yyyy-mm-dd_hh-mm-ss

These files are stored in a special directory (default name: "!versions") which is created as subdirectory in the current dir.
If you want to let them be saved in the current directory (along with the original file) you can do this by setting/leaving this parameter empty.



For easier usage it's nice to add the macro to the {User} or {Tools} menu.
If called that way you can control it's behavior.
So my {User} menu now has 3 more entries:

128
FileVersion Menu
Call_File(100, "FileVers.vdm")
0
FileVersion: Save as new version
#120='S' Call_File(100, "FileVers.vdm")
0
FileVersion: Get old version
#120='G' Call_File(100, "FileVers.vdm")



Pay attention:
- The macro returns without action if the current buffer has no filename.
- Due to the used Dialog_Input_1() command the macro only runs with the Windows version of VEDIT.
- The compare feature uses a temporary copy of the current file and opens both files in browse mode.
So there are no direct modifications to the files possible. (It's not a bug - it's a feature.)


Christian


PS: Outdated attachment deleted (23.11.2002)

 


Topic: File Version Generator (Multi-BAK :-) ) (17 of 17), Read 37 times, 1 File Attachment
Conf: VEDIT Macro Library
From: Christian Ziemski
Date: Tuesday, December 03, 2002 04:03 PM

I fixed a bug:

When (re)loading an old file version the macro failed if the file was too big.

The new macro version is attached.

Christian

 
FILEVERS.VDM (22KB)