[cvsnt] Manually renaming files

Oliver Giesen giesen at lucatec.de
Wed Aug 7 13:44:18 BST 2002


> >I myself prefer a middle ground between Tony's approach and yours
> >however:
> >- *copy* the ,v file in the repository to its new name/location.

> >- checkout the new file

> >- cvs remove and commit the old file (i.e. marking it as DEAD)

oops, forgot one more (optional) step:

- force-commit the new file (this way you could leave a log message
that notes the renaming - I usually do this in one go with committing
the removed old file)

> >- use cvs admin -s to mark all revisions of the new file previous
to
> >the rename as DEAD.
> >
> That sounds useful... I didn't know you could mark old revisions as
> dead.

Yes you could. Doing so prevents them from being checked out (or
purges them from the working copy) when updating to that older
revision.


> I could probably implement a cvs rename function based on that
> idea.
>
> Are there any drawbacks to your approach that you have found?

Apart from the fact that manually marking previous revisions dead
could probably get quite tiresome if the history is big (you have to
do each revision individually, as there's no range syntax as it exists
for admin -o), I couldn't think of any right now.

In all fairness I should probably point out that (speaking of our
production repository):
- I have only done this three or four times before
- the files in question did neither have a long revision history nor
branches
- in our shop there's hardly any concurrent development to speak of;
i.e. noone but me has ever done anything to those files but update
them
- I have only once had to retrieve a revision from before the rename
(but that worked just fine)

IOW it's almost a hypothetical solution and has not been tested under
any kind of stress yet but it definitely works for me and seems
sensible enough.

I have just done some more toying on a test repository with this
method and it seemed to be working alright AFAICT. What I haven't
tested too heavily yet is how to apply this technique when branches
come into the play. I have also only tested with individual files not
with directories.

Here's an example of how WinCvs-style Graphs of a file renamed in this
way might look (view with a fixed-width font):

File_Old              File_New
  |                     |
 1.1                  (1.1)
  |                     |
 1.2 -[pre-Rename]    (1.2) -[pre-Rename]
  |                     |
(1.3)                  1.3  -[Rename] {forced revision}
                        |
                       1.4
                        |
                       ...

(dead revisions are in parentheses, tags in brackets, comments in
squigglies)


Cheers,

Oliver
----	------------------
JID:	ogiesen at jabber.org
ICQ:	18777742
Y! :	ogiesen




More information about the cvsnt mailing list