[svnbook commit] r1591 - in trunk/src/ru: . book

dmitriy svnbook-dev at red-bean.com
Sat Aug 6 03:18:05 CDT 2005


Author: dmitriy
Date: Sat Aug  6 03:18:03 2005
New Revision: 1591

Removed:
   trunk/src/ru/statusof.py
Modified:
   trunk/src/ru/TRANSLATION-STATUS
   trunk/src/ru/book/appa.xml   (props changed)
   trunk/src/ru/book/appb.xml   (props changed)
   trunk/src/ru/book/appc.xml   (props changed)
   trunk/src/ru/book/book.xml   (contents, props changed)
   trunk/src/ru/book/ch00.xml   (props changed)
   trunk/src/ru/book/ch01.xml   (props changed)
   trunk/src/ru/book/ch02.xml   (props changed)
   trunk/src/ru/book/ch03.xml   (props changed)
   trunk/src/ru/book/ch04.xml   (contents, props changed)
   trunk/src/ru/book/ch05.xml   (props changed)
   trunk/src/ru/book/ch06.xml   (props changed)
   trunk/src/ru/book/ch07.xml   (props changed)
   trunk/src/ru/book/ch08.xml   (props changed)
   trunk/src/ru/book/ch09.xml   (props changed)
   trunk/src/ru/book/copyright.xml   (props changed)
   trunk/src/ru/book/foreword.xml   (props changed)
   trunk/src/ru/sync.py
Log:
* ru/TRANSLATION-STATUS
  Now this file contain only a general description, used in a file status
  property. Status of translation stored in svn-property 'status' for
  each file separately

* ru/statusof.py: deleting this file and integrating his functions into...
* ru/sync.py: ...this file

* ru/book/appa.xml
* ru/book/appb.xml
* ru/book/appc.xml
* ru/book/foreword.xml
* ru/book/ch00.xml
* ru/book/ch01.xml
* ru/book/ch02.xml
* ru/book/ch03.xml
* ru/book/ch05.xml
* ru/book/ch06.xml
* ru/book/ch07.xml
* ru/book/ch08.xml
* ru/book/ch09.xml
* ru/book/copyright.xml
  Add svn-property 'status', for store translation status of file

* ru/book/book.xml: added property 'status' and missing para

* ru/book/ch04.xml: added property 'status' and translation of
  svn.branchmerge.copychanges, svn.branchmerge.copychanges.specific,
  svn.branchmerge.copychanges.keyconcept


Modified: trunk/src/ru/TRANSLATION-STATUS
==============================================================================
--- trunk/src/ru/TRANSLATION-STATUS	(original)
+++ trunk/src/ru/TRANSLATION-STATUS	Sat Aug  6 03:18:03 2005
@@ -2,88 +2,58 @@
 Status file for the Russian translation of the Subversion
 documentation.
 
-1. Synchronisation history against the English version
-
-  The revision number for the last synchronisation is stored in the
-  LAST_UPDATED file.
+Status of translation for each file is stored in svn-property 'status'.
+For looking or changing this status use corresponding svn commands.
+For example:
 
-2. File status
+  svn propget status book/ch00.xml
 
-  2.1. /trunk
+0. Urgent needs
 
-    2.1.1 Urgent needs
+   book/ch00.xml:
+     - Finish translation of svn.preface.acks, somewhat depends on
+       ru/ProperNames.
 
-      book/ch00.xml:
-        - Finish translation of svn.preface.acks, somewhat depends on
-          ru/ProperNames.
+1. Synchronisation history against the English version
 
-    2.1.2. Finished
+  The revision number for the last synchronisation is stored in
+  svn-property 'last-sync', for each file separately.
 
-      These files have been translated, edited, proofread and are in
-      sync with LAST_UPDATED revision number.
+2. Possible values of property 'status':
 
-      book/book.xml
-      book/foreword.xml
+  Finished
 
-      book/images/ch01dia1.png
-      book/images/ch02dia1.png
+      These files have been translated, edited, proofread and are in
+      sync with 'last-sync' revision number.
 
-    2.1.3. Needs update
+  Needs update
 
       These files have been "Finished" before, but recent changes are not
       yet translated.
 
-      [none yet]
-
-    2.1.4. Translation in progress
+  Translation in progress
 
       These files are partially translated and work is continued by the
       specified commiter, or they are in process of being updated.
 
-      book/ch04.xml dmitriy 20%
-      book/ch09.xml Maverick.Crank.GRey 0% [Initial translation]
-
-    2.1.5. Forsaken
+  Forsaken
 
       These files are partially translated and wait for someone
       interested enough to continue.
 
-      book/ch00.xml [svn.preface.acks]
-      book/ch02.xml [svn.basic.in-action.mixedrevs]
-
-    2.1.6  Not translated
+  Not translated
 
       These files have never been translated.
 
-      book/ch05.xml
-      book/ch06.xml
-      book/ch07.xml
-      book/ch08.xml
-      book/appa.xml
-      book/appb.xml
-      book/appc.xml
-      book/copyright.xml
-      book/images/ch02dia2.png
-      book/images/ch02dia3.png
-      book/images/ch02dia4.png
-      book/images/ch02dia5.png
-      book/images/ch04dia1.png
-      book/images/ch04dia4.png
-
-    2.1.7. Ready for editing
+  Ready for editing
 
       These files are ready for editing, translation work is finished on
       them for now.
 
-      book/ch03.xml
-
-    2.1.8. Editing in progress
+  Editing in progress
 
       These files are being proofread and edited now.
 
-      book/ch01.xml [@svn.intro.install]
-
-
 3. Technical errors
 
   The following files have markup problems, screaming for attention.

Modified: trunk/src/ru/book/book.xml
==============================================================================
--- trunk/src/ru/book/book.xml	(original)
+++ trunk/src/ru/book/book.xml	Sat Aug  6 03:18:03 2005
@@ -78,12 +78,19 @@
       <holder>C. Michael Pilato</holder>
     </copyright>
 
-    <legalnotice><para>Этот труд выпущен на условиях Creative Commons 
-        Attribution License. С текстом данной лицензии можно 
-        ознакомиться в интернете по адресу 
-        http://creativecommons.org/licenses/by/2.0/, или получить его по  
-        почте, отправив заявку по адресу Creative Commons, 559 Nathan 
-        Abbott Way, Stanford, California 94305, 
+    <!-- @ENGLISH {{{
+    <legalnotice><para>This work is licensed under the Creative
+      Commons Attribution License. To view a copy of this license,
+      visit http://creativecommons.org/licenses/by/2.0/ or send a
+      letter to Creative Commons, 559 Nathan Abbott Way, Stanford,
+      California 94305, USA.</para></legalnotice>
+    @ENGLISH }}} -->
+    <legalnotice><para>Этот труд выпущен на условиях Creative Commons
+        Attribution License. С текстом данной лицензии можно
+        ознакомиться в интернете по адресу
+        http://creativecommons.org/licenses/by/2.0/, или получить его по
+        почте, отправив заявку по адресу Creative Commons, 559 Nathan
+        Abbott Way, Stanford, California 94305,
         USA.</para></legalnotice>
 
   </bookinfo>

Modified: trunk/src/ru/book/ch04.xml
==============================================================================
--- trunk/src/ru/book/ch04.xml	(original)
+++ trunk/src/ru/book/ch04.xml	Sat Aug  6 03:18:03 2005
@@ -792,6 +792,7 @@
   <!-- ================================================================= -->
   <!-- ================================================================= -->
   <sect1 id="svn.branchmerge.copychanges">
+    <!-- @ENGLISH {{{
     <title>Copying Changes Between Branches</title>
 
     <para>Now you and Sally are working on parallel branches of the
@@ -805,7 +806,21 @@
       likely to disrupt the trunk, a standard procedure is to create a
       private branch and commit changes there until all the work is
       complete.</para>
+    @ENGLISH }}} -->
+    <title>Копирование изменений между ветками</title>
 
+    <para>Сейчас вы и Салли работаете над паралельными ветками проекта:
+      вы работаете над своей собственной веткой, а Салли работает над
+      главной линией разработки (<firstterm>trunk</firstterm>).</para>
+
+    <para>В проектах, имеющих большое количество участников, как правило
+      большинство участников имеют рабочую копию главной линии разработки.
+      Когда кому-то необходимо сделать долгосрочные изменения,
+      которые возможно нарушат главную линию, стандартной процедурой
+      является создать отдельную ветку и фиксировать изменения туда
+      пока работа не будет полностью завершена.</para>
+
+    <!-- @ENGLISH {{{
     <para>So, the good news is that you and Sally aren't interfering
       with each other.  The bad news is that it's very easy to drift
       <emphasis>too</emphasis> far apart.  Remember that one of the
@@ -820,9 +835,27 @@
       <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>
+    @ENGLISH }}} -->
+    <para>Положительным моментом является то, что вы и Салли не
+      пересекаетесь друг с другом. Отрицательный момент в том, что
+      вы можете разойтись <emphasis>слишком</emphasis> далеко друг
+      отностительно друга. Помните, что одной из проблем такой
+      <quote>сходящейся к тупику</quote> стратегии является то,
+      что к моменту, когда вы закончите работу со своей веткой
+      может буть практически невозможно снова объединить ваши изменения
+      с главной линией без огромного количества конфликтов.</para>
+
+    <para>Вместо этого вы и Салли можете продолжать делиться изменениями
+      по ходу работы. Вы можете решать вплоть до отдельного изменения,
+      стоит ли им делиться; Subversion предоставляет возможность
+      ваборочного <quote>копирования</quote> изменений между ветками.
+      А тогда, когда ваша ветка будет полностью закончена, полный набор
+      изменений ветки может быть скопирован обратно в основную
+      ветку.</para>
 
     <!-- =============================================================== -->
     <sect2 id="svn.branchmerge.copychanges.specific">
+      <!-- @ENGLISH {{{
       <title>Copying Specific Changes</title>
 
 
@@ -845,6 +878,28 @@
         in the repository and describe the differences.  For example,
         you can ask <command>svn diff</command> to show you the exact
         change made by Sally in revision 344:</para>
+      @ENGLISH }}} -->
+      <title>Копирование отдельных изменений</title>
+
+      <para>В предыдущем пункте мы указали, что и вы и Салли, в месте,
+        в разных ветках вносите изменения в <filename>integer.c</filename>.
+        Если посмотреть на лог сообщение Салли для правки 344, вы увидите,
+        что она исправила несколько орфаграфических ошибок. Конечно же,
+        в вашей копии этого файла эти ошибки остались. Возможно, что
+        ваши будущие изменения для этого файла коснутся областей которые
+        содержат орфографические ошибки и таким образом вы получите несколько
+        потенциальных конфликтов при последующем объединении вашей ветки.
+        По-этому, лучше получить изменения Салли сейчас,
+        <emphasis>до</emphasis> того, как вы начнете вплотную работать в
+        этих областях файла.</para>
+
+      <para>Настал момент воспользоваться командой <command>svn
+        merge</command>. Эта команда, оказывается, является очень близким
+        родственником команды <command>svn diff</command> (о кторой вы
+        читали Главе 3). Обе эти команды способны сравнивать любые два
+        объекта в хранилище и показывать изменения. Например, вы можете
+        попросить <command>svn diff</command> показать все изменения
+        сделаные Салли в правке 344:</para>
 
 <screen>
 $ svn diff -r 343:344 http://svn.example.com/repos/calc/trunk
@@ -891,10 +946,16 @@
      printf("error: fseek() returned non-zero\n");
 </screen>
 
+      <!-- @ENGLISH {{{
       <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>
+      @ENGLISH }}} -->
+      <para>Команда <command>svn merge</command> ведет себя практически
+        полностью идентично. Но вместо вывода различий на терминал,
+        применяет их к рабочей копии в виде <emphasis>локальных
+        изменений</emphasis>:</para>
 
 <screen>
 $ svn merge -r 343:344 http://svn.example.com/repos/calc/trunk
@@ -904,6 +965,7 @@
 M  integer.c
 </screen>
 
+      <!-- @ENGLISH {{{
       <para>The output of <command>svn merge</command> shows that your
         copy of <filename>integer.c</filename> was patched.  It now
         contains Sally's change—the change has been
@@ -918,17 +980,45 @@
         conflict using standard procedures (see Chapter 3), or if you
         decide that the merge was a bad idea altogether, simply give up
         and <command>svn revert</command> the local change.</para>
+      @ENGLISH }}} -->
+      <para>Вывод команды <command>svn merge</command> показывает, что
+        к вашей копии <filename>integer.c</filename> был применен патч.
+        Теперь она содержит изменения Салли — изменеия Салли были
+        <quote>скопированы</quote> из главной линии разработки в вашу
+        рабочую копию, вашей личной ветки и теперь существуют в виде
+        локальных изменений. С этого момента вы можете просмотреть локальные
+        изменения и убедиться в том, что они корректно работают.</para>
+
+      <para>По другому сценарию, возможно, что не все будет так хорошо
+        и <filename>integer.c</filename> может оказаться в состоянии
+        конфликта. Вам необходимо будет при помощи стандартной процедуры
+        (см. Главу 3) решить конфликт, либо если вы прийдете к мнению, что
+        объединение было плохой идеей, просто отказаться от него, отменив
+        локальные изменения командой <command>svn revert</command>.
 
+      <!-- @ENGLISH {{{
       <para>But assuming that you've reviewed the merged change, you can
         <command>svn commit</command> the change as usual.  At that
         point, the change has been merged into your repository branch.
         In version control terminology, this act of copying changes
         between branches is commonly called
-        <firstterm>porting</firstterm> changes.</para>
+
 
       <para>When you commit the local modification, make sure your log
         message mentions that you're porting a specific change from
         one branch to another.  For example:</para>
+      @ENGLISH }}} -->
+      <para>После просмотра результата объединения изменений, можно
+        их как обычно зафиксировать (<command>svn commit</command>).
+        После этого изменения будут внесены в вашу ветку хранилища.
+        В терминах контроля версий такую процедуру копирования
+        изменений между ветками обычно называют
+        <firstterm>портированием</firstterm> изменений.</para>
+
+      <para>При фиксации локальных изменений, убедитесь, что в лог
+        сообщении упоминается о портировании отдельных изменений
+        из одной ветки в другую. Например:</para>
+
 
 <screen>
 $ svn commit -m "integer.c: ported r344 (spelling fixes) from trunk."
@@ -937,6 +1027,7 @@
 Committed revision 360.
 </screen>
 
+      <!-- @ENGLISH {{{
       <para>As you'll see in the next sections, this is a very
         important <quote>best practice</quote> to follow.</para>
 
@@ -948,6 +1039,18 @@
           all?  Why not simply use the operating system's
           <command>patch</command> command to accomplish the same job?
           For example:</para>
+      @ENGLISH }}} -->
+      <para>Как вы увидите в последующих разделах, очень важно следовать
+        подобному <quote>хорошему стилю</quote> организации работы.
+
+      <sidebar>
+        <title>Почему бы не использовать вместо этого патчи?</title>
+
+        <para>Вопрос, который может крутиться у вас в голове, особенно
+          если вы пользователь Unix: зачем вообще связываться с
+          <command>svn merge</command>? Почему просто не использовать
+          команду операционной системы <command>patch</command> для
+          выполнения этой работы? Например:</para>
 
 <screen>
 $ svn diff -r 343:344 http://svn.example.com/repos/calc/trunk > patchfile
@@ -960,6 +1063,7 @@
 done
 </screen>
 
+        <!-- @ENGLISH {{{
         <para>In this particular case, yes, there really is no
           difference.  But <command>svn merge</command> has special
           abilities that surpass the <command>patch</command> program.
@@ -980,9 +1084,31 @@
           The <command>svn merge</command> command, however, can express
           tree-changes by directly applying them to your working
           copy.</para>
+        @ENGLISH }}} -->
+        <para>Для этого этого конкретного случая, да, действительно разници
+          нет. Однако, <command>svn merge</command> имеет специфические
+          функции благодаря которым превосходит программу
+          <command>patch</command>.
+          Формат файлов, используемый программой <command>patch</command>
+          довольно таки ограниченый; он способен передавать только изменения
+          содержимого файлов. Он не имеет способа для представления изменений
+          <emphasis>дерева</emphasis> файлов, таких, как добавление, удаление
+          или переименование файлов и директорий. Если скажем, в результате
+          изменений Салли, добавилась новая директория то в выводе
+          <command>svn diff</command> упоминания об этом не будет.
+          Вывод <command>svn diff</command> представляет собой только
+          ограниченый патч-формат, по этому некоторые понятия он просто не
+          может передать. <footnote><para>В будущем, проект Subversion
+          планирует воспользоваться (или изобрести) расширеный формат
+          представления различий, который будет передавть изменения в
+          структуре дерева файлов.</para></footnote> Комманда
+          <command>svn merge</command>, на против, может передавать
+          изменения в структуре файлов, непосредственно применяя их к
+          рабочей копии.</para>
 
       </sidebar>
 
+      <!-- @ENGLISH {{{
       <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
@@ -1004,7 +1130,29 @@
             directory.</para>
         </listitem>
       </orderedlist>
+      @ENGLISH }}} -->
+      <para>Небольшое предупреждение: несмотря на то, что <command>svn
+        diff</command> и <command>svn merge</command> очень похожи в
+        основе, в большинстве случаев они имеют разные правила записи.
+        Обязательно прочтите об этом в Главе 9, или спросите у
+        <command>svn help</command>. Например, <command>svn
+        merge</command> требует в качестве целевого объекта путь в
+        рабочей копии, т. е. место, где ей нужно применить изменения
+        структуры файлов. Если целевой объект не указан, предпологается,
+        что делается попытка выполнить одну из следующих операций:</para>
+
+      <orderedlist>
+        <listitem>
+          <para>Вы хотите объединить изменения директории с вашй текущей
+            рабочей дирикторией.</para>
+        </listitem>
+        <listitem>
+          <para>Вы хотите объединить изменения в конкретном файле с
+            файлом имеющим то-же имя в текущей рабочей директории.</para>
+        </listitem>
+      </orderedlist>
 
+      <!-- @ENGLISH {{{
       <para>If you are merging a directory and haven't specified a
         target path, <command>svn merge</command> assumes the first case
         above and tries to apply the changes into your current
@@ -1017,6 +1165,19 @@
         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>
+      @ENGLISH }}} -->
+      <para>Если вы объединяете директорию и не указываете целевой путь
+        <command>svn merge</command> предпологает первый из приведеных выше
+        вариантов и попытается применить изменения к текущей директории.
+        Если вы объединяете файл и такой файл (то есть файл с таким именем)
+        существует в текущей рабочей директории, <command>svn merge</command>
+        подразумевает второй случай и пытается применить изменения
+        к локальному файлу с таким же именем.</para>
+
+      <para>Если вы хотите применить изменения к чему-то другому, вам
+        нужно это указать. Например, если вы находитесь в родительской
+        директории рабочей копии то вам нужно указать целевую директорию,
+        получающую изменения:</para>
 
 <screen>
 $ svn merge -r 343:344 http://svn.example.com/repos/calc/trunk my-calc-branch
@@ -1027,6 +1188,7 @@
 
     <!-- =============================================================== -->
     <sect2 id="svn.branchmerge.copychanges.keyconcept">
+      <!-- @ENGLISH {{{
       <title>The Key Concept Behind Merging</title>
 
       <para>You've now seen an example of the <command>svn
@@ -1049,7 +1211,29 @@
         diff-and-apply</command>, because that's all that happens:
         two repository trees are compared, and the differences are
         applied to a working copy.</para>
+      @ENGLISH }}} -->
+      <title>Ключевые понятия, стоящие за слиянием</title>
+
+      <para>Вы увидели примеры использования <command>svn
+        merge</command>, продолжим рассмотрение. Если вы чувствуете
+        не увереность  в том как собственно работает слияние, то в этом
+        вы не одиноки. Многие пользователи (особенно те, для которых
+        управление версиями в новинку) поначалу путаются в правильности
+        записи этой команды и в том, как и когда эту функцию следует
+        использовать. Отбросьте страх, на самом деле эта команда намного
+        проще чем вы думаете! Очень просто понять механизм
+        того, как именно ведет себя <command>svn merge</command>.</para>
+
+      <para>В замешательство приводит, главным образом
+        <emphasis>название</emphasis> команды. Термин <quote>слияние</quote>
+        как бы указывает на то, что ветки соединяются вместе, или
+        происходит какое-то волшебное смешивание данных. На самом деле это
+        не так. Лучшим названием для этой команды могло быть <command>svn
+        diff-and-apply</command> потому что это все, что происходит:
+        сравниваются два файловых дерева хранилища, а различия переносятся
+        в рабочую копию.</para>
 
+      <!-- @ENGLISH {{{
       <para>The command takes three arguments:</para>
 
       <orderedlist>
@@ -1067,7 +1251,26 @@
         of the merge).</para></listitem>
 
       </orderedlist>
+      @ENGLISH }}} -->
+      <para>Команда принимает три аргумента:</para>
+
+      <orderedlist>
+
+        <listitem><para>Начальное дерево хранилища (как правило,
+          называемое <firstterm>левой частью</firstterm>
+          при сравнении),</para></listitem>
+
+        <listitem><para>Конечное дерево хранилища (как правило
+          называемое <firstterm>правой частью</firstterm> при
+          сревнении),</para></listitem>
+
+        <listitem><para>Рабочую копию для применения отличий,
+          в виде локальных изменений (как правило, называемую
+          <firstterm>целью</firstterm> слияния).</para></listitem>
+
+      </orderedlist>
 
+      <!-- @ENGLISH {{{
       <para>Once these three arguments are specified, the two trees
         are compared, and the resulting differences are applied to the
         target working copy as local modifications.  When the command
@@ -1081,6 +1284,21 @@
       <para>The syntax of <command>svn merge</command> allows you to
         specify the three necessary arguments rather flexibly.  Here
         are some examples:</para>
+      @ENGLISH }}} -->
+      <para>Когда эти три аргумента указаны, сравниваются два дерева
+        и результирующие различия применяются к целевой рабочей копии
+        в виде локальных изменений. После того, как команда выполнена,
+        результат не будет отличаться он того как если бы вы вручную
+        редактировали файлы или многократно выполняли команды
+        <command>svn add</command> или <command>svn delete</command>
+        самостоятельно. Если результат вас устраивает, его можно
+        зафиксировать. Если результат вас не устраивает, просто
+        отмените (<command>svn revert</command>) все сделанные
+        изменения.</para>
+
+      <para>Правила записи <command>svn merge</command> позволяют
+        указывать три необходимых аргумента довольно гибко. Вот
+        несколько примеров:</para>
 
 <screen>
 $ svn merge http://svn.example.com/repos/branch1@150 \

Modified: trunk/src/ru/sync.py
==============================================================================
--- trunk/src/ru/sync.py	(original)
+++ trunk/src/ru/sync.py	Sat Aug  6 03:18:03 2005
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 
-import sys, os, string, getopt, re, glob
+import sys, os, string, getopt, re
 
 bfiles = ['appa.xml', 'appb.xml', 'appc.xml', 'book.xml', 'ch00.xml', \
           'ch01.xml', 'ch02.xml', 'ch03.xml', 'ch04.xml', 'ch05.xml', \
@@ -25,10 +25,44 @@
 def set_last(fname, last):
   os.system('svn propset last-sync '+last+' '+fname)
 
-def get_base():
-  for line in os.popen('svn info'):
-    if re.match('Revision: ', line):
-      return int(re.sub('Revision: ', '', line))
+def get_base(fname = ''):
+  global bfiles
+  if fname != '':
+    for line in os.popen('svn info '+fname):
+      if re.match('Revision: ', line):
+        return int(re.sub('Revision: ', '', line))
+  else:
+    rmin = 0xffffffff
+    rlist = []
+    for file in bfiles:
+      for line in os.popen('svn info '+file):
+        if re.match('Revision: ', line):
+          rev = int(re.sub('Revision: ', '', line))
+      if rev < rmin:
+        rmin = rev
+      rlist.append(rev)
+    return max(rlist)
+
+def get_status(fname):
+  f = file(fname)
+  ru = 0.0
+  en = 0.001
+  in_tr = in_para = False
+  for line in f:
+    if re.search('^( *|\t*)\<\!-- @ENGLISH \{\{\{', line):
+      in_tr = True
+    if re.search('^ *\<para>', line):
+      in_para = True
+    if in_para or re.search('^ *\<para>.*\</para>$', line):
+      if in_tr:
+        ru += 1
+      else:
+        en += 1
+    if re.search('\</para>$', line):
+      in_para = False
+    if re.search('@ *ENGLISH \}\}\} -->$', line):
+      in_tr = False
+  return "(%3.2f%%)" % ((ru / en) * 100)
 
 def get_list():
   global bfiles
@@ -44,11 +78,11 @@
   rdelta2 = rbase - ((rbase - rmin) / 3)
   for f, r in frlist:
     if r in range(rdelta2, rbase):
-      print '\x1b[32m', f, '\t', r, '\x1b[0m'
+      print '\x1b[32m', f, '\t', r, '\t', get_status(f), '\x1b[0m'
     elif r in range(rdelta1, rdelta2):
-      print '\x1b[33m', f, '\t', r, '\x1b[0m'
+      print '\x1b[33m', f, '\t', r, '\t', get_status(f), '\x1b[0m'
     elif r in range(rmin, rdelta1):
-      print '\x1b[31m', f, '\t', r, '\x1b[0m'
+      print '\x1b[31m', f, '\t', r, '\t', get_status(f), '\x1b[0m'
 
 def main():
   global bfiles
@@ -71,7 +105,7 @@
       return get_list()
   cmd = string.Template('svn $a -r $r1:$r2 https://svn.red-bean.com/svnbook/trunk/src/en/book/$t')
   last = get_last(fname)
-  base = get_base()
+  base = get_base(fname)
   print ('########################################################################')
   print 'Sync r%(r1)s:r%(r2)s' % { 'r1' :  last, 'r2' : base }
   diff = os.popen(cmd.substitute(a='diff', r1=last, r2=base, t=fname)).read()



More information about the svnbook-dev mailing list