Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Collins-Sussman B.Version control with Subversion 1.1.pdf
Скачиваний:
9
Добавлен:
23.08.2013
Размер:
1.53 Mб
Скачать

Guided Tour

$ svn cat --revision 2 rules.txt > rules.txt.v2

$

You're probably wondering why we don't just use svn update --revision to update the file to the older revision. There are a few reasons why we might prefer to use svn cat.

First, you may want to see the differences between two revisions of a file using an external diff program (perhaps a graphical one, or perhaps your file is in such a format that the output of unified diff is nonsensical). In this case, you'll need to grab a copy of the old revision, redirect it to a file, and pass both that and the file in your working copy to your external diff program.

Sometimes it's easier to look at an older version of a file in its entirety as opposed to just the differences between it and another revision.

svn list

The svn list command shows you what files are in a repository directory without actually downloading the files to your local machine:

$ svn list http://svn.collab.net/repos/svn README

branches/

clients/

tags/

trunk/

If you want a more detailed listing, pass the --verbose (-v) flag to get output like this:

$ svn list --verbose http://svn.collab.net/repos/svn

2755

harry

1331 Jul

28

02:07 README

2773

sally

Jul

29

15:07 branches/

2769

sally

Jul

29

12:07 clients/

2698

harry

Jul

24

18:07

tags/

2785

sally

Jul

29

19:07

trunk/

The columns tell you the revision at which the file or directory was last modified, the user who modified it, the size if it is a file, the date it was last modified, and the item's name.

A Final Word on History

In addition to all of the above commands, you can use svn update and svn checkout with the --revision switch to take an entire working copy “back in time” 6:

$ svn checkout --revision 1729 # Checks out a new working copy at r1729

$ svn update --revision 1729 # Updates an existing working copy to r1729

Other Useful Commands

6See? We told you that Subversion was a time machine.

39

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