Some new macros available for review

"Oliver Giesen" <[email protected]> Thu, 23 Dec 2004 00:05:21 +0100
Newsgroups gmane.comp.version-control.cvs.gui.devel
Message-ID <000b01c4e87a$b6cf2760$4701a8c0@g01>
Today I had a look at my macros folder and noticed a few macros which I
hadn't donated yet. There's one which I finished just last week and some
which had been sitting there for up to a year.

So far I have only added them on my experimental branch
Exp-MacroWork-BRANCH. I would welcome some comments on them before I merge
them into the trunk as most of them haven't gone through any kind of heavy
testing yet and in one case I'm not even sure whether it's maybe not too
specific to be included in the main distribution.

In detail the new macros are these:

ChangeSubstModeTk.py "Change File Options"
This is the newest addition. As discussed on the CVSNT list recently, it
will change the k-option of selected files by using a sequence of cvs
admin -k, cvs update -k, cvs commit -f (the commit is optional, though if
your server is CVSNT 2.0.52 or later it's technically required). At least
one of those 3 commands is usually not strictly necessary but doing it that
way ensures that it should work with all versions of CVS and CVSNT servers.

MoveBranchPointToHead.py "Move branchpoint to HEAD"
This is actually one which I use a lot. It comes in handy when you work with
long-lived branches where only a relatively small subset of files ever
changes and the rest remain on the trunk. Using this macro I could move the
branch tag on all the files that have no branch revisions yet forward to
HEAD whenever I make changes on the trunk without having to actually merge
these changes into the branch.

ChangeRepo.py "Change Module Path"
This is mostly copy&pasted from the Change CVSROOT macro and performs a
similar operation on the ./CVS/Repository files. This could be used when you
have physically reorganized your repository's module hierarchy and want to
avoid doing a fresh checkout.

ExtDiffFiles.py "Externally diff selected files"
This was originally born out of a proof-of-concept type of experiment to
read WinCvs settings from within a macro. It lets you select any two
arbitrary files and invoke the external diff application on them. There is
also some code prepared for diffing arbitrary revisions of two files but
it's incomplete and commented out for now as I wasn't able to get the cvs
up -p functionality working on the first attempt and then something else got
in the way... maybe later. I think I will eventually use this one as a basis
for a Tortoise-style "externally resolve conflict" macro...

Override2ndPartyAdd.py "Override Second-Party Add"
This is probably the most crude of the new macros and I'm really not sure it
is worth committing. The situation which spawned this was this: Our
documentation writer was not very experienced in using CVS yet and so
whenever she wanted to "freeze" a version of her docs, instead of placing a
tag or even creating a branch, she copied the whole sandbox folder.
Occasionally she would (accidentally) return to work on a superceded copy
and even add new files there. Eventually she would wonder where those files
went when she couldn't find them in her most recent copy of the docs so she
created them again and tried to cvs add them. Obviously she got the error
"File xyz has been added independently by a second-party" (or something to
that effect). Now, what this macro does in that situation is:
1. backup the selected file
2. Retrieve the already added file via Update
3. Overwrite the retrieved file with the backed up newer one
...effectively leaving you with a file in a modified/committable state in
your sandbox which could then be diffed the one that was added previously.


For more details on how to apply the macros, as always, look at the comment
section at the beginning of the corresponding .py files.


What do you think? Are these worthwhile? Do they work for you? Any
suggestions?
Anxiously awaiting your comments.

Oliver
---- ------------------
JID: [email protected]
MSN:  [email protected]
ICQ: 18777742 (http://wwp.icq.com/18777742)



------------------------ Yahoo! Groups Sponsor --------------------~--> 
$4.98 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/Q7_YsB/neXJAA/yQLSAA/NhFolB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/cvsgui-dev/

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/