[svnbook commit] r1511 - in trunk/src/ru: . book
dmitriy
svnbook-dev at red-bean.com
Sat Jul 2 07:00:37 CDT 2005
Author: dmitriy
Date: Sat Jul 2 07:00:35 2005
New Revision: 1511
Added:
trunk/src/ru/statusof.py (contents, props changed)
Modified:
trunk/src/ru/TRANSLATION-STATUS
trunk/src/ru/book/ch00.xml
trunk/src/ru/book/ch03.xml
trunk/src/ru/book/ch04.xml
trunk/src/ru/sync.py
Log:
* ru/TRANSLATION-STATUS
Status of files ch03.xml, ch04.xml is changed
* ru/statusof.py
New script for a rough estimate of quantity of the translated text
* ru/sync.py
Fixing bug with 'action'
* ru/book/ch00.xml
Replacing <TAB> with <SPACE>
* ru/book/ch03.xml
Translation finished
* ru/book/ch04.xml
Translation started
Modified: trunk/src/ru/TRANSLATION-STATUS
==============================================================================
--- trunk/src/ru/TRANSLATION-STATUS (original)
+++ trunk/src/ru/TRANSLATION-STATUS Sat Jul 2 07:00:35 2005
@@ -40,7 +40,7 @@
These files are partially translated and work is continued by the
specified commiter, or they are in process of being updated.
- book/ch03.xml dmitriy 75%
+ book/ch04.xml dmitriy 2%
book/ch09.xml Maverick.Crank.GRey 0% [Initial translation]
2.1.5. Forsaken
@@ -54,7 +54,6 @@
These files have never been translated.
- book/ch04.xml
book/ch05.xml
book/ch06.xml
book/ch07.xml
@@ -76,6 +75,7 @@
them for now.
book/ch02.xml
+ book/ch03.xml
2.1.8. Editing in progress
Modified: trunk/src/ru/book/ch00.xml
==============================================================================
--- trunk/src/ru/book/ch00.xml (original)
+++ trunk/src/ru/book/ch00.xml Sat Jul 2 07:00:35 2005
@@ -47,7 +47,7 @@
и её полубеспорядочная модель разработки стали краеугольными
камнями культуры свободного программного обеспечения.</para>
- <!-- @ENGLISH {{{
+ <!-- @ENGLISH {{{
<para>But like many tools, CVS is starting to show its age.
Subversion is a relatively new version control system designed
to be the successor to CVS. The designers set out to win the
@@ -58,7 +58,7 @@
version control design, Subversion <emphasis>is</emphasis> very
powerful, very usable, and very flexible.
</para>
- @ENGLISH }}} -->
+ @ENGLISH }}} -->
<para>Однако, несмотря на все достоинства CVS, её возраст даёт о себе
знать. Subversion представляет собой относительно молодую систему
управления версиями, призванную прийти на смену CVS. Её разработчики
Modified: trunk/src/ru/book/ch03.xml
==============================================================================
--- trunk/src/ru/book/ch03.xml (original)
+++ trunk/src/ru/book/ch03.xml Sat Jul 2 07:00:35 2005
@@ -2932,12 +2932,19 @@
------------------------------------------------------------------------
</screen>
+ <!-- @ENGLISH {{{
<para>Note that the log messages are printed in
<emphasis>reverse chronological order</emphasis> by default.
If you wish to see a different range of revisions in a
particular order, or just a single revision, pass the
- <option>--revision</option> (<option>-r</option>)
+ <option>-ﳢ-revision</option> (<option>-r</option>)
switch:</para>
+ @ ENGLISH }}} -->
+ <para>Обратите внимание на то, что по умолчанию лог сообщения
+ выводятся в <emphasis>обратном хронологическом порядке</emphasis>.
+ Если вам нужно увидеть другой диапазон правок в заранее определенном
+ порядке или только одну правку, укажите параметр
+ <option>--revision</option> (<option>-r</option>):</para>
<screen>
$ svn log --revision 5:19 # shows logs 5 through 19 in chronological order
@@ -2947,8 +2954,12 @@
$ svn log -r 8 # shows log for revision 8
</screen>
+ <!-- @ENGLISH {{{
<para>You can also examine the log history of a single file or
directory. For example:</para>
+ @ ENGLISH }}} -->
+ <para>Кроме того, можно проанализировать историю лог сообщений
+ отдельного файла или директории. Например:</para>
<screen>
$ svn log foo.c
@@ -2957,18 +2968,32 @@
…
</screen>
+ <!-- @ENGLISH {{{
<para>These will display log messages <emphasis>only</emphasis>
for those revisions in which the working file (or URL)
changed.</para>
<para>If you want even more information about a file or
directory, <command>svn log</command> also takes a
- <option>--verbose</option> (<option>-v</option>) switch.
+ <option>-ﳢ-verbose</option> (<option>-v</option>) switch.
Because Subversion allows you to move and copy files and
directories, it is important to be able to track path changes
in the filesystem, so in verbose mode, <command>svn
log</command> will include a list of changed paths in a
revision in its output:</para>
+ @ ENGLISH }}} -->
+ <para>В результате, будут показаны лог сообщения
+ <emphasis>только</emphasis> для тех правок, в которых рабочий
+ файл (или URL) изменялись.</para>
+
+ <para>Если вам нужно еще больще информации о файле или директории,
+ то для <command>svn log</command> есть параметр
+ <option>--verbose</option> (<option>-v</option>). Так как
+ Subversion позволяет перемещать и копировать файлы и директории,
+ важной является возможность отслеживания изменений путей в
+ файловой системе, по-этому в режиме расширеного вывода,
+ <command>svn log</command> включает перечень измененных в правке
+ путей:</para>
<screen>
$ svn log -r 8 -v
@@ -2985,11 +3010,17 @@
</screen>
<sidebar>
+ <!-- @ENGLISH {{{
<title>Why Does <command>svn log</command> Give Me an Empty
Response?</title>
<para>After working with Subversion for a bit, most users will
come across something like this:</para>
+ @ ENGLISH }}} -->
+ <title>Почему <command>svn log</command> ничего не выводит?</title>
+
+ <para>Поработав немного с Subversion, многие пользователи
+ сталкиваются с чем-то подобным этому:</para>
<screen>
$ svn log -r 2
@@ -2997,6 +3028,7 @@
$
</screen>
+ <!-- @ENGLISH {{{
<para>At first glance, this seems like an error. But recall
that while revisions are repository-wide, <command>svn
log</command> operates on a path in the repository. If you
@@ -3009,6 +3041,20 @@
revision, try pointing <command>svn log</command> directly at
the top-most URL of your repository, as in <command>svn log -r 2
http://svn.collab.net/repos/svn</command>.</para>
+ @ ENGLISH }}} -->
+ <para>На первый взгляд это похоже на ошибку. Однако учтите, что
+ так как правки привязаны к хранилищу, <command>svn log</command>
+ использует путь из хранилища. Если путь просто не указан,
+ Subversion по умолчанию будет использовать в качестве целевого
+ объекта текущую рабочую директорию. И в результате, если вы
+ находитесь в поддиректории рабочей копии и попытаетесь
+ посмотреть лог правки в которой ни эта директориия ни ее
+ поддиректории не менялись, Subversion покажет пустой лог.
+ Если вы хотите знать, что менялось в этой правке, попробуйте
+ направить <command>svn log</command> прямо на самый верхний URL
+ вашего хранилища, примерно вот так <command>svn log -r 2
+ http://svn.collab.net/repos/svn</command>.</para>
+
</sidebar>
@@ -3017,6 +3063,7 @@
<sect2 id="svn.tour.history.diff">
<title><command>svn diff</command></title>
+ <!-- @ENGLISH {{{
<para>We've already seen <command>svn diff</command>
before—it displays file differences in unified diff
format; it was used to show the local modifications made to
@@ -3025,9 +3072,19 @@
<para>In fact, it turns out that there are
<emphasis>three</emphasis> distinct uses of <command>svn
diff</command>:</para>
+ @ ENGLISH }}} -->
+ <para>Ранее, мы уже познакомились с <command>svn diff</command>
+ — эта команда показывает различия файла в объединенном формате
+ представления различий; она использовалась, для того, что бы показать
+ локальные изменения внесенные в рабочую копию перед их фиксацией в
+ хранилище.</para>
+
+ <para>Вообще, существует <emphasis>три</emphasis> возможных варианта
+ использования <command>svn diff</command>:</para>
<itemizedlist>
+ <!-- @ENGLISH {{{
<listitem>
<para>Examine local changes</para>
</listitem>
@@ -3039,16 +3096,36 @@
<listitem>
<para>Compare repository to repository</para>
</listitem>
+ @ ENGLISH }}} -->
+ <listitem>
+ <para>Анализ локальных изменений</para>
+ </listitem>
+
+ <listitem>
+ <para>Сравнение рабочей копии с хранилищем</para>
+ </listitem>
+
+ <listitem>
+ <para>Сравнение хранилища с хранилищем</para>
+ </listitem>
</itemizedlist>
<sect3 id="svn.tour.history.diff.local">
+ <!-- @ENGLISH {{{
<title>Examining Local Changes</title>
<para>As we've seen, invoking <command>svn diff</command> with
no switches will compare your working files to the cached
<quote>pristine</quote> copies in
the <filename>.svn</filename> area:</para>
+ @ ENGLISH }}} -->
+ <title>Анализ локальных изменений</title>
+
+ <para>Как мы уже знаем, запуск <command>svn diff</command> без
+ параметров сравнивает рабочие файлы, с кешироваными
+ в <filename>.svn</filename> <quote>первоначальными</quote>
+ копиями:</para>
<screen>
$ svn diff
@@ -3069,12 +3146,19 @@
</sect3>
<sect3 id="svn.tour.history.diff.wcrepos">
+ <!-- @ENGLISH {{{
<title>Comparing Working Copy to Repository</title>
- <para>If a single <option>--revision</option>
+ <para>If a single <option>-ﳢ-revision</option>
(<option>-r</option>) number is passed, then your
working copy is compared to the specified revision in the
repository.</para>
+ @ ENGLISH }}} -->
+ <title>Сравнение рабочей копии с хранилищем</title>
+
+ <para>Если в <option>--revision</option> (<option>-r</option>)
+ указан один номер, то рабочая копия сравнивается
+ с указаной паравкой хранилища.</para>
<screen>
$ svn diff --revision 3 rules.txt
@@ -3095,12 +3179,19 @@
</sect3>
<sect3 id="svn.tour.history.diff.reposrepos">
+ <!-- @ENGLISH {{{
<title>Comparing Repository to Repository</title>
<para>If two revision numbers, separated by a colon, are
- passed via <option>--revision</option>
+ passed via <option>-ﳢ-revision</option>
(<option>-r</option>), then the two revisions are directly
compared.</para>
+ @ ENGLISH }}} -->
+ <title>Сравнение хранилища с хранилищем</title>
+
+ <para>Если через <option>--revision</option> (<option>-r</option>)
+ передаются две правки, разделенные двоеточием, то непосредственно
+ сравниваются две правки.</para>
<screen>
$ svn diff --revision 2:3 rules.txt
@@ -3117,6 +3208,7 @@
$
</screen>
+ <!-- @ENGLISH {{{
<para>Not only can you use <command>svn diff</command> to
compare files in your working copy to the repository, but if
you supply a URL argument, you can examine the differences
@@ -3124,6 +3216,13 @@
working copy. This is especially useful if you wish to
inspect changes in a file when you don't have a working copy
on your local machine:</para>
+ @ ENGLISH }}} -->
+ <para><command>svn diff</command> можно использовать не только
+ для сравнения файлов в рабочей копии, если вы укажите
+ в качестве аргумента URL, то сможете анализировать различия между
+ элементами, даже не имея рабочей копии. Это полезно в случае,
+ если вы хотите проверить изменения в файла тогда когда у вас нет его
+ рабочей копии на локальной машине:</para>
<screen>
$ svn diff --revision 4:5 http://svn.red-bean.com/repos/example/trunk/text/rules.txt
@@ -3138,9 +3237,14 @@
<sect2 id="svn.tour.history.cat">
<title><command>svn cat</command></title>
+ <!-- @ENGLISH {{{
<para>If you want to examine an earlier version of a file and
not necessarily the differences between two files, you can use
<command>svn cat</command>:</para>
+ @ ENGLISH }}} -->
+ <para>Если вы хотите проанализировать ранние версии файла, а не
+ различия между двумя файлами, можно воспользоваться
+ <command>svn cat</command>:</para>
<screen>
$ svn cat --revision 2 rules.txt
@@ -3151,16 +3255,20 @@
$
</screen>
+ <!-- @ENGLISH {{{
<para>You can also redirect the output directly into a
file:</para>
+ @ ENGLISH }}} -->
+ <para>Или вы можете перенаправить вывод прямо в файл:</para>
<screen>
$ svn cat --revision 2 rules.txt > rules.txt.v2
$
</screen>
+ <!-- @ENGLISH {{{
<para>You're probably wondering why we don't just use
- <command>svn update --revision</command> to update the file to
+ <command>svn update -ﳢ-revision</command> to update the file to
the older revision. There are a few reasons why we might
prefer to use <command>svn cat</command>.</para>
@@ -3175,15 +3283,38 @@
<para>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.</para>
+ @ ENGLISH }}} -->
+ <para>Вероятно, вам интересно почему мы не воспользовались
+ <command>svn update --revision</command>, что бы обновить
+ файл старой правкой. Есть несколько причин, почему нам
+ предпочтительнее воспользоваться
+ <command>svn cat</command>.</para>
+
+ <para>Во первых, возможно вы хотите увидеть различия между
+ двумя правками одного файла используя внешнюю программу
+ просмотра различий (возможно с графическим интерфейсом
+ или может быть файл в таком формате, что объединенный вывод
+ различий не имеет смысла) В этом случае, вам нужно вытащить
+ копию старой правки, перенаправить ее в файл и передать
+ этот файл вместе с файлом в рабочей копии внешней программе
+ просмотра различий.</para>
+
+ <para>Иногда проще посмотреть полную старую версию файла чем
+ только различия между ним и его другой правкой.</para>
</sect2>
<sect2 id="svn.tour.history.list">
<title><command>svn list</command></title>
+ <!-- @ENGLISH {{{
<para>The <command>svn list</command> command shows you what
files are in a repository directory without actually
downloading the files to your local machine:</para>
+ @ ENGLISH }}} -->
+ <para>Комманда <command>svn list</command> показывает содержимое
+ директории в хранилише, при этом не закачивая его на локальную
+ машину:</para>
<screen>
$ svn list http://svn.collab.net/repos/svn
@@ -3194,9 +3325,14 @@
trunk/
</screen>
+ <!-- @ENGLISH {{{
<para>If you want a more detailed listing, pass the
- <option>--verbose</option> (<option>-v</option>) flag to get
+ <option>-ﳢ-verbose</option> (<option>-v</option>) flag to get
output like this:</para>
+ @ ENGLISH }}} -->
+ <para>Если вам нужен более детальный листинг, тогда воспользуйтесь
+ флагом <option>--verbose</option> (<option>-v</option>) чтобы увидеть
+ нечто, подобное этому:</para>
<screen>
$ svn list --verbose http://svn.collab.net/repos/svn
@@ -3207,22 +3343,37 @@
2785 sally Jul 29 19:07 trunk/
</screen>
+ <!-- @ENGLISH {{{
<para>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.</para>
+ @ ENGLISH }}} -->
+ <para>Колонки показывают правку, в которой файл или директория последний
+ раз менялись, имя пользователя делавшего изменения, размер если это
+ файл, дату последнего изменения и имя елемента.</para>
</sect2>
<sect2 id="svn.tour.history.finalword">
+ <!-- @ENGLISH {{{
<title>A Final Word on History</title>
<para>In addition to all of the above commands, you can use
<command>svn update</command> and <command>svn
- checkout</command> with the <option>--revision</option> switch
+ checkout</command> with the <option>-ﳢ-revision</option> switch
to take an entire working copy <quote>back in time</quote>
<footnote><para>See? We told you that Subversion was a time
machine.</para></footnote>:</para>
+ @ ENGLISH }}} -->
+ <title>Заключительное слово о истории</title>
+
+ <para>Дополнительно ко всем упомянутым выше командам, можно
+ воспользоваться <command>svn update</command> и <command>svn
+ checkout</command> с параметром <option>--revision</option>
+ для того, что бы переместить рабочую копию <quote>назад во
+ времени</quote><footnote><para>Видите? Мы же говорили вам,
+ что Subversion это машина времени.</para></footnote>:</para>
<screen>
$ svn checkout --revision 1729 # Checks out a new working copy at r1729
@@ -3240,15 +3391,23 @@
<!-- ======================== SECTION 7 ============================== -->
<!-- ================================================================= -->
<sect1 id="svn.tour.other">
+ <!-- @ENGLISH {{{
<title>Other Useful Commands</title>
<para>While not as frequently used as the commands previously
discussed in this chapter, you will occasionally need these
commands.</para>
+ @ ENGLISH }}} -->
+ <title>Другие полезные команды</title>
+
+ <para>При том, что эти команды используются не так часто как те
+ которые рассматривались ранее в этой главе, иногда эти команды вам
+ все таки понадобятся.</para>
<sect2 id="svn.tour.other.cleanup">
<title><command>svn cleanup</command></title>
+ <!-- @ENGLISH {{{
<para>When Subversion modifies your working copy (or any
information within <filename>.svn</filename>), it tries to do
so as safely as possible. Before changing the working copy,
@@ -3269,6 +3428,27 @@
<quote>locked</quote>, then this is the command that you
should run. Also, <command>svn status</command> will display
an <literal>L</literal> next to locked items:</para>
+ @ ENGLISH }}} -->
+ <para>Когда Subversion изменяет рабочую копию (или любую информацию
+ в области <filename>.svn</filename>) она пытается делать это
+ безопастно настолько, насколко это возмоно. Перед изменением рабочей
+ копии Subversion записывает свои намерения в лог файл. Затем
+ для выполнения запрошеных изменений она выполняет команды из лог
+ файла. И в конце Subversion удаляет лог файл. Архитектурно, это
+ напоминает журналируемую файловую систему. Если работа Subversion
+ была прервана (в результате того, что процес был убит или, например,
+ из-за машинного сбоя) лог файлы остаются на диске. Перезапустив
+ выполнение лог файлов, Subversion может завершить предварительно
+ начатые операции и рабочая копия снова вернется в согласованное
+ состояние.</para>
+
+ <para>Что собственно делает <command>svn cleanup</command>:
+ в рабочей копии выполняет поиск и выполнение незавершенных лог файлов,
+ удаляя походу блокировки. Если Subversion когда нибудь говорила вам о
+ том, что часть рабочей копии <quote>заблокирована</quote> тогда вам
+ нужно запустить эту команду. Кроме того <command>svn status</command>
+ покажет для заблокированых элементов букву
+ <literal>L</literal>:</para>
<screen>
$ svn status
@@ -3286,9 +3466,14 @@
<sect2 id="svn.tour.other.import">
<title><command>svn import</command></title>
+ <!-- @ENGLISH {{{
<para>The <command>svn import</command> command is a quick way
to copy an unversioned tree of files into a repository,
creating intermediate directories as necessary.</para>
+ @ ENGLISH }}} -->
+ <para>Команда <command>svn import</command> это быстрый способ
+ скопировать неверсионированое дерево файлов в хранилище,
+ Создавая при необходимости промежуточные директории.</para>
<screen>
$ svnadmin create /usr/local/svn/newrepos
@@ -3302,9 +3487,14 @@
Committed revision 1.
</screen>
+ <!-- @ENGLISH {{{
<para>The previous example copied the contents of directory
<filename>mytree</filename> under the directory
<filename>some/project</filename> in the repository:</para>
+ @ ENGLISH }}} -->
+ <para>В предыдещем примере выполняется копирование содержимого
+ директории <filename>mytree</filename> в директорию
+ <filename>some/project</filename> хранилища:</para>
<screen>
$ svn list file:///usr/local/svn/newrepos/some/project
@@ -3313,10 +3503,17 @@
subdir/
</screen>
+ <!-- @ENGLISH {{{
<para>Note that after the import is finished, the original tree
is <emphasis>not</emphasis> converted into a working copy. To
start working, you still need to <command>svn
checkout</command> a fresh working copy of the tree.</para>
+ @ ENGLISH }}} -->
+ <para>Обратите внимание на то, что после завершения импорта,
+ оригинальное дерево файлов <emphasis>не</emphasis>
+ конвертируется в рабочую копию. Для того, чтобы начать работать вам
+ необходимо создать новую рабочую копию (<command>svn
+ checkout</command>) дерева файлов.</para>
</sect2>
@@ -3326,6 +3523,7 @@
<!-- ======================== SECTION 8 ============================== -->
<!-- ================================================================= -->
<sect1 id="svn.tour.summary">
+ <!-- @ENGLISH {{{
<title>Summary</title>
<para>Now we've covered most of the Subversion client commands.
@@ -3336,6 +3534,17 @@
get an idea of all the many different commands that Subversion
has—and how you can use them to make your work
easier.</para>
+ @ ENGLISH }}} -->
+ <title>Подводя итоги</title>
+
+ <para>На настоящий момент мы рассмотрели большинство команд Subversion
+ клиента. За исключением тех, которые предназначены для работы с
+ ветвлениями и слияниями (см. <xref linkend="svn.branchmerge"/>) и
+ свойствами (см. <xref linkend="svn.advanced.props"/>). Кроме этого,
+ найдите время просмотреть <xref linkend="svn.ref"/> для того, что бы
+ получить представление обо всем многообразии имеющихся у Subversion
+ команд — и о том как с их помощью вы можете упростить свою
+ работу.</para>
</sect1>
Modified: trunk/src/ru/book/ch04.xml
==============================================================================
--- trunk/src/ru/book/ch04.xml (original)
+++ trunk/src/ru/book/ch04.xml Sat Jul 2 07:00:35 2005
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<chapter id="svn.branchmerge">
-
+
<!-- @ENGLISH {{{
<title>Branching and Merging</title>
@ ENGLISH }}} -->
@@ -9,6 +9,7 @@
<simplesect>
+ <!-- @ENGLISH {{{
<para>Branching, tagging, and merging are concepts common to
almost all version control systems. If you're not familiar with
these ideas, we provide a good introduction in this chapter. If
@@ -20,6 +21,18 @@
is a feature you'll eventually come to depend on. This chapter
assumes that you're already familiar with Subversion's basic
concepts (<xref linkend="svn.basic"/>).</para>
+ @ ENGLISH }}} -->
+ <para>Ветвление, назначение меток и слияние понятия свойственые
+ практически всем системам управления версиями. Если вы плохо
+ знакомы с этими понятиями, то в этой гллаве мы предллагаем хорошее
+ введение. Еси эти понятия вам знакомы, тогда надеемся что вам будет
+ интересно узнать как эти идеи реаизует Subversion.</para>
+
+ <para>Ветвение это фундоментаьное понятие управения версиями.
+ Еси вы доверии Subversion управять своей информацией, то эта
+ функция от которой со временем вы будете зависеть. Эта глава
+ предпоогает, что вы уже знакомы с основными понятиями
+ Subversion (<xref linkend="svn.basic"/>).</para>
</simplesect>
@@ -27,7 +40,8 @@
<!-- ======================== SECTION 1 ============================== -->
<!-- ================================================================= -->
<sect1 id="svn.branchmerge.whatis">
- <title>What's a Branch?</title>
+ <!-- @ENGLISH {{{
+ <title>What's a Branch?</title>
<para>Suppose it's your job to maintain a document for a division
in your company, a handbook of some sort. One day a different
@@ -40,6 +54,22 @@
the two copies separately. As each department asks you to make
small changes, you incorporate them into one copy or the
other.</para>
+ @ ENGLISH }}} -->
+
+ <title>Что такое ветка?</title>
+
+ <para>Предположим, что ваша работа заключается в сопровождении
+ документа, например какого-то руководства, для подразделений
+ в вашей компании. Однажды различные подразделения запросят у вас
+ одно и то-же руководство, но с несколькими частями которые будут
+ немного <quote>подредактированы</quote>, так как задачи у них
+ немного различаются.</para>
+
+ <para>Как вы поступите в такой ситуации? Вы делаете очевидную вещь:
+ создаете вторую копию документа и начинаете сопровождать две
+ отдельных копии. Когда какое-то из подразделений просит вас
+ внести небольшие изменения, вы включаете их или в одну копию или
+ в другую.</para>
<para>You often want to make the same change to both copies. For
example, if you discover a typo in the first copy, it's very
@@ -70,12 +100,12 @@
your daily work.</para>
</sect1>
-
+
<!-- ================================================================= -->
<!-- ======================== SECTION 2 ============================== -->
<!-- ================================================================= -->
<sect1 id="svn.branchmerge.using">
- <title>Using Branches</title>
+ <title>Using Branches</title>
<para>At this point, you should understand how each commit creates
an entire new filesystem tree (called a <quote>revision</quote>)
@@ -90,7 +120,7 @@
project directory now contains subdirectories named
<filename>trunk</filename> and <filename>branches</filename>.
The reason for this will soon become clear.</para>
-
+
<figure id="svn.branchmerge.using.dia-1">
<title>Starting repository layout</title>
<graphic fileref="images/ch04dia2.png"/>
@@ -147,8 +177,8 @@
on.</para>
<sect2 id="svn.branchmerge.using.create">
- <title>Creating a Branch</title>
-
+ <title>Creating a Branch</title>
+
<para>Creating a branch is very simple—you make a copy of
the project in the repository using the <command>svn
copy</command> command. Subversion is not only able to copy
@@ -230,7 +260,7 @@
<filename>/calc/trunk</filename>. This is shown in <xref
linkend="svn.branchmerge.using.create.dia-1"/>. Notice that the second method,
however, performs an <emphasis>immediate</emphasis> commit.
- <footnote>
+ <footnote>
<para>Subversion does not support
cross-repository copying. When using URLs with <command>svn
copy</command> or <command>svn move</command>, you can only
@@ -240,15 +270,15 @@
check out a large mirror of the repository. In fact, this
technique doesn't even require you to have a working copy at
all.</para>
-
+
<figure id="svn.branchmerge.using.create.dia-1">
<title>Repository with new copy</title>
<graphic fileref="images/ch04dia3.png"/>
</figure>
-
+
<sidebar>
<title>Cheap Copies</title>
-
+
<para>Subversion's repository has a special design. When you
copy a directory, you don't need to worry about the
repository growing huge—Subversion doesn't actually
@@ -261,7 +291,7 @@
changes—the rest of the files continue to exist as
links to the original files in the original
directory.</para>
-
+
<para>This is why you'll often hear Subversion users talk
about <quote>cheap copies</quote>. It doesn't matter how
large the directory is—it takes a very tiny, constant
@@ -281,9 +311,9 @@
</sidebar>
</sect2>
-
+
<sect2 id="svn.branchmerge.using.work">
- <title>Working with Your Branch</title>
+ <title>Working with Your Branch</title>
<para>Now that you've created a branch of the project, you can
check out a new working copy to start using it:</para>
@@ -427,7 +457,7 @@
</sect2>
<sect2 id="svn.branchmerge.using.concepts">
- <title>The Key Concepts Behind Branches</title>
+ <title>The Key Concepts Behind Branches</title>
<para>There are two important lessons that you should remember
from this section.</para>
@@ -481,18 +511,18 @@
that by the time you're finished with your branch, it may be
near-impossible to merge your changes back into the trunk
without a huge number of conflicts.</para>
-
+
<para>Instead, you and Sally might continue to share changes as
you work. It's up to you to decide which changes are worth
sharing; Subversion gives you the ability to selectively
<quote>copy</quote> changes between branches. And when you're
completely finished with your branch, your entire set of branch
changes can be copied back into the trunk.</para>
-
+
<sect2 id="svn.branchmerge.copychanges.specific">
<title>Copying Specific Changes</title>
-
+
<para>In the previous section, we mentioned that both you and
Sally made changes to <filename>integer.c</filename> on
@@ -519,8 +549,8 @@
Index: integer.c
===================================================================
---- integer.c (revision 343)
-+++ integer.c (revision 344)
+--- integer.c (revision 343)
++++ integer.c (revision 344)
@@ -147,7 +147,7 @@
case 6: sprintf(info->operating_system, "HPFS (OS/2 or NT)"); break;
case 7: sprintf(info->operating_system, "Macintosh"); break;
@@ -536,34 +566,34 @@
high = high << 8; /* interpret MSB correctly */
- total = low + high; /* add them togethe for correct total */
+ total = low + high; /* add them together for correct total */
-
+
info->extra_header = (unsigned char *) my_malloc(total);
fread(info->extra_header, total, 1, gzfile);
@@ -241,7 +241,7 @@
Store the offset with ftell() ! */
-
+
if ((info->data_offset = ftell(gzfile))== -1) {
- printf("error: ftell() retturned -1.\n");
+ printf("error: ftell() returned -1.\n");
exit(1);
}
-
+
@@ -249,7 +249,7 @@
printf("I believe start of compressed data is %u\n", info->data_offset);
#endif
-
+
- /* Set postion eight bytes from the end of the file. */
+ /* Set position eight bytes from the end of the file. */
-
+
if (fseek(gzfile, -8, SEEK_END)) {
printf("error: fseek() returned non-zero\n");
</screen>
-
+
<para>The <command>svn merge</command> command is almost exactly
the same. Instead of printing the differences to your
terminal, however, it applies them directly to your working
copy as <emphasis>local modifications</emphasis>:</para>
-
+
<screen>
$ svn merge -r 343:344 http://svn.example.com/repos/calc/trunk
U integer.c
@@ -610,7 +640,7 @@
<sidebar>
<title>Why Not Use Patches Instead?</title>
-
+
<para>A question may be on your mind, especially if you're a
Unix user: why bother to use <command>svn merge</command> at
all? Why not simply use the operating system's
@@ -650,7 +680,7 @@
copy.</para>
</sidebar>
-
+
<para>A word of warning: while <command>svn diff</command> and
<command>svn merge</command> are very similar in concept, they
do have different syntax in many cases. Be sure to read about
@@ -668,7 +698,7 @@
</listitem>
<listitem>
<para>You want to merge the changes in a specific file into
- a file by the same name which exists in your current working
+ a file by the same name which exists in your current working
directory.</para>
</listitem>
</orderedlist>
@@ -680,12 +710,12 @@
by the same name) exists in your current working directory,
<command>svn merge</command> assumes the second case and tries
to apply the changes to a local file with the same name.</para>
-
+
<para>If you want changes applied somewhere else, you'll
need to say so. For example, if you're sitting in the parent
directory of your working copy, you'll have to specify the
target directory to receive the changes:</para>
-
+
<screen>
$ svn merge -r 343:344 http://svn.example.com/repos/calc/trunk my-calc-branch
U my-calc-branch/integer.c
@@ -732,7 +762,7 @@
<listitem><para>A working copy to accept the differences as
local changes (often called the <firstterm>target</firstterm>
of the merge).</para></listitem>
-
+
</orderedlist>
<para>Once these three arguments are specified, the two trees
@@ -749,11 +779,11 @@
specify the three necessary arguments rather flexibly. Here
are some examples:</para>
-<screen>
+<screen>
$ svn merge http://svn.example.com/repos/branch1@150 \
http://svn.example.com/repos/branch2@212 \
my-working-copy
-
+
$ svn merge -r 100:200 http://svn.example.com/repos/trunk my-working-copy
$ svn merge -r 100:200 http://svn.example.com/repos/trunk
@@ -769,7 +799,7 @@
</sect2>
-
+
<sect2 id="svn.branchmerge.copychanges.bestprac">
<title>Best Practices for Merging</title>
@@ -817,15 +847,15 @@
technique in action.</para>
</sect3>
-
+
<sect3 id="svn.branchmerge.copychanges.bestprac.preview">
<title>Previewing Merges</title>
-
+
<para>Because merging only results in local modifications,
it's not usually a high-risk operation. If you get the
merge wrong the first time, simply <command>svn
revert</command> the changes and try again.</para>
-
+
<para>It's possible, however, that your working copy might
already have local modifications. The changes applied by a
merge will be mixed with your pre-existing ones, and running
@@ -980,7 +1010,7 @@
merge.</para>
</sect3>
-
+
<sect3 id="svn.branchmerge.copychanges.bestprac.ancestry">
<title>Noticing or Ignoring Ancestry</title>
@@ -1080,7 +1110,7 @@
tree with your latest branch tree. But beware—this
assumption is <emphasis>wrong</emphasis>, and has burned many
a new user! Since <command>svn merge</command> operates like
- <command>svn diff</command>, comparing the latest trunk and
+ <command>svn diff</command>, comparing the latest trunk and
branch trees will <emphasis>not</emphasis> merely describe
the set of changes you made to your branch. Such a comparison
shows too many changes: it would not only show the addition of
@@ -1122,7 +1152,7 @@
$
</screen>
-
+
<para>As expected, the final revision printed by this command
is the revision in which <filename>my-calc-branch</filename>
was created by copying.</para>
@@ -1187,7 +1217,7 @@
------------------------------------------------------------------------
…
</screen>
-
+
<para>Aha! Since all branch-changes that happened between
revisions 341 and 405 were previously merged to the trunk as
revision 406, you now know that you want to merge only the
@@ -1265,7 +1295,7 @@
change, we're asking <command>svn merge</command> to apply
changeset #303 to our working copy
<emphasis>backwards</emphasis>.</para>
-
+
<para>Keep in mind that rolling back a change like this is just
like any other <command>svn merge</command> operation, so you
should use <command>svn status</command> and <command>svn
@@ -1372,7 +1402,7 @@
<para>That was the hard part—the research. Now that you
know what you want to restore, you have two different
choices.</para>
-
+
<para>One option is to use <command>svn merge</command> to apply
revision 808 <quote>in reverse</quote>. (We've already
discussed how to undo changes, see <xref
@@ -1441,10 +1471,10 @@
Subversion; they're applicable to any version control system.
Still, it may help to see them described in Subversion
terms.</para>
-
+
<sect3 id="svn.branchmerge.commonuses.patterns.release">
<title>Release Branches</title>
-
+
<para>Most software has a typical lifecycle: code, test,
release, repeat. There are two problems with this process.
First, developers need to keep writing new features while
@@ -1492,7 +1522,7 @@
process stops. The branch is <quote>frozen</quote> for
final testing right before a release.</para>
</listitem>
-
+
<listitem>
<para><emphasis>The branch is tagged and released.</emphasis>
@@ -1529,7 +1559,7 @@
<sect3 id="svn.branchmerge.commonuses.patterns.feature">
<title>Feature Branches</title>
-
+
<para>A <firstterm>feature branch</firstterm> is the sort of
branch that's been the dominant example in this chapter, the
one you've been working on while Sally continues to work on
@@ -1695,7 +1725,7 @@
working copy to mirror the branch.</para>
</listitem>
</orderedlist>
-
+
<para>In other words, if a user knows that the branch-work only
needs to happen on a specific subdirectory, they use
<command>svn switch</command> to move only that subdirectory to
@@ -1708,7 +1738,7 @@
working copy</quote>—not only can working copies contain a
mixture of working revisions, but a mixture of repository
locations as well.</para>
-
+
<para>If your working copy contains a number of switched subtrees
from different repository locations, it continues to function as
normal. When you update, you'll receive patches to each subtree
@@ -1727,10 +1757,10 @@
See the <command>svn switch</command> section in <xref
linkend="svn.ref"/> for more information and an example.</para>
</footnote></para>
-
+
<sidebar>
<title>Switches and Updates</title>
-
+
<para>Have you noticed that the output of <command>svn
switch</command> and <command>svn update</command> look the
same? The switch command is actually a superset of the
@@ -1742,7 +1772,7 @@
client. The only difference between <command>svn
switch</command> and <command>svn update</command> is that the
update command always compares two identical paths.</para>
-
+
<para>That is, if your working copy is a mirror of
<filename>/calc/trunk</filename>, then <command>svn
update</command> will automatically compare your working copy
@@ -1855,14 +1885,14 @@
This is version control, after all.</para>
</sect2>
-
+
<sect2 id="svn.branchmerge.tags.mkcomplex">
<title>Creating a Complex Tag</title>
-
+
<para>Sometimes you may want your <quote>snapshot</quote> to be
more complicated than a single directory at a single
revision.</para>
-
+
<para>For example, pretend your project is much larger than our
<filename>calc</filename> example: suppose it contains a
number of subdirectories and many more files. In the course
@@ -1930,7 +1960,7 @@
<sect2 id="svn.branchmerge.maint.layout">
<title>Repository Layout</title>
-
+
<para>There are some standard, recommended ways to organize a
repository. Most people create a <filename>trunk</filename>
directory to hold the <quote>main line</quote> of development,
@@ -1981,9 +2011,9 @@
longer exists, and the user will be forced to <command>svn
switch</command> to the new location.
</para>
-
+
</sect2>
-
+
<sect2 id="svn.branchmerge.maint.lifetime">
<title>Data Lifetimes</title>
@@ -2088,7 +2118,7 @@
</chapter>
<!--
-local variables:
+local variables:
sgml-parent-document: ("book.xml" "chapter")
end:
vim: tw=78:ft=svnbook
Modified: trunk/src/ru/sync.py
==============================================================================
--- trunk/src/ru/sync.py (original)
+++ trunk/src/ru/sync.py Sat Jul 2 07:00:35 2005
@@ -2,21 +2,20 @@
import sys, os, string
+subcmd = ("diff", "di", "log", "merge")
+
def usage(err_msg):
stream = err_msg and sys.stderr or sys.stdout
if err_msg:
stream.write("ERROR: %s\n\n" % (err_msg))
stream.write("""Usage: %(name)s <subcommand> [filename]
-Valid subcommands:
- diff (di)
- log
- merge
+Valid subcommands: %(valid_subcmd)s
Examples:
%(name)s log book/foreword.xml
%(name)s diff
-""" % { 'name' : os.path.basename(sys.argv[0]) })
+""" % { 'name' : os.path.basename(sys.argv[0]), 'valid_subcmd' : subcmd })
sys.exit(err_msg and 1 or 0)
def main():
@@ -24,7 +23,7 @@
if len(sys.argv) < 2:
usage(None)
- if not sys.argv[1] in ("diff", "di", "log", "merge"):
+ if not sys.argv[1] in subcmd:
usage("Invalid syntax")
book_src_url = "https://svn.red-bean.com/svnbook/trunk/src/en/book/"
@@ -37,19 +36,20 @@
os.chdir("book")
if len(sys.argv) > 2:
- cmd = "svn " + action + " -r " + last_up_rev + ":HEAD " + book_src_url + \
+ cmd = "svn " + sys.argv[1] + " -r " + last_up_rev + ":HEAD " + book_src_url + \
os.path.basename(sys.argv[2])
print cmd
os.system(cmd)
else:
- cmd = "svn " + action + " -r " + last_up_rev + ":HEAD " + book_src_url
+ cmd = "svn " + sys.argv[1] + " -r " + last_up_rev + ":HEAD " + book_src_url
print cmd
os.system(cmd)
- if string.lower(raw_input("Whether to udate 'LAST_UPDATED'? [y/N] ")) == 'y':
- os.chdir("..")
- cmd = "svnversion . --no-newline > LAST_UPDATED"
- print cmd
- os.system(cmd)
+ if sys.argv[1] == 'merge':
+ if string.lower(raw_input("Whether to udate 'LAST_UPDATED'? [y/N] ")) == 'y':
+ os.chdir("..")
+ cmd = "svnversion . --no-newline > LAST_UPDATED"
+ print cmd
+ os.system(cmd)
if __name__ == "__main__":
main()
More information about the svnbook-dev
mailing list