Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Cederqvist P.Version management with CVS 1.11.21.pdf
Скачиваний:
4
Добавлен:
23.08.2013
Размер:
1.11 Mб
Скачать

Chapter 7: Adding, removing, and renaming files and directories

57

$ cd ~/dir

 

$ rm old

 

$ cvs remove old

 

$ cvs commit old

 

# Remove all tags from new

 

$ cvs update new

 

$ cvs log new

# Remember the non-branch tag names

$ cvs tag -d tag1 new

 

$ cvs tag -d tag2 new

 

...

 

By removing the tags you will be able to check out old revisions. Advantages:

• Checking out old revisions works correctly, as long as you use ‘-rtag’ and not ‘-Ddate’ to retrieve the revisions.

The log of changes is maintained intact.

The revision numbers are not a ected.

Disadvantages:

• You cannot easily see the history of the file across the rename.

7.5 Moving and renaming directories

The normal way to rename or move a directory is to rename or move each file within it as described in Section 7.4.1 [Outside], page 56. Then check out with the ‘-P’ option, as described in Section 7.3 [Removing directories], page 55.

If you really want to hack the repository to rename or delete a directory in the repository, you can do it like this:

1.Inform everyone who has a checked out copy of the directory that the directory will be renamed. They should commit all their changes in all their copies of the project containing the directory to be removed, and remove all their working copies of said project, before you take the steps below.

2.Rename the directory inside the repository.

$ cd $CVSROOT/parent-dir

$mv old-dir new-dir

3.Fix the cvs administrative files, if necessary (for instance if you renamed an entire module).

4.Tell everyone that they can check out again and continue working.

If someone had a working copy the cvs commands will cease to work for him, until he removes the directory that disappeared inside the repository.

It is almost always better to move the files in the directory instead of moving the directory. If you move the directory you are unlikely to be able to retrieve old releases correctly, since they probably depend on the name of the directories.

58

CVS—Concurrent Versions System v1.11.21

Соседние файлы в предмете Электротехника