[svnbook commit] r1577 - in trunk/src/ru: . book
dmitriy
svnbook-dev at red-bean.com
Sun Jul 31 12:46:52 CDT 2005
Author: dmitriy
Date: Sun Jul 31 12:46:51 2005
New Revision: 1577
Modified:
trunk/src/ru/book/appa.xml (contents, props changed)
trunk/src/ru/book/appb.xml (contents, props changed)
trunk/src/ru/book/appc.xml (contents, props changed)
trunk/src/ru/book/book.xml (props changed)
trunk/src/ru/book/ch00.xml (contents, props changed)
trunk/src/ru/book/ch01.xml (contents, props changed)
trunk/src/ru/book/ch02.xml (contents, props changed)
trunk/src/ru/book/ch03.xml (contents, props changed)
trunk/src/ru/book/ch04.xml (contents, props changed)
trunk/src/ru/book/ch05.xml (contents, props changed)
trunk/src/ru/book/ch06.xml (contents, props changed)
trunk/src/ru/book/ch07.xml (contents, props changed)
trunk/src/ru/book/ch08.xml (contents, props changed)
trunk/src/ru/book/ch09.xml (contents, props changed)
trunk/src/ru/book/copyright.xml (props changed)
trunk/src/ru/book/foreword.xml (contents, props changed)
trunk/src/ru/book/styles.css (props changed)
trunk/src/ru/sync.py
Log:
* ru/sync.py
Changed for use a svn propety 'last-sync' instead of tag <edition>
* ru/book/appa.xml
* ru/book/appb.xml
* ru/book/appc.xml
* ru/book/foreword.xml
* ru/book/ch00.xml
* ru/book/book.xml
* ru/book/ch01.xml
* ru/book/ch02.xml
* ru/book/ch03.xml
* ru/book/ch04.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
* ru/book/styles.css
Replacing tag <edition> by property 'last-sync'
Modified: trunk/src/ru/book/appa.xml
==============================================================================
--- trunk/src/ru/book/appa.xml (original)
+++ trunk/src/ru/book/appa.xml Sun Jul 31 12:46:51 2005
@@ -5,9 +5,6 @@
<title>Subversion for CVS Users</title>
@ENGLISH }}} -->
<title>Subversion для пользователей CVS</title>
- <appendixinfo>
- <edition>1575</edition>
- </appendixinfo>
<!-- See also svn.preface.organization -->
<simplesect>
Modified: trunk/src/ru/book/appb.xml
==============================================================================
--- trunk/src/ru/book/appb.xml (original)
+++ trunk/src/ru/book/appb.xml Sun Jul 31 12:46:51 2005
@@ -4,9 +4,6 @@
<title>WebDAV and Autoversioning</title>
@ENGLISH }}} -->
<title>WebDAV и автоматическое управление версиями</title>
- <appendixinfo>
- <edition>1575</edition>
- </appendixinfo>
<!-- See also svn.preface.organization -->
<simplesect>
Modified: trunk/src/ru/book/appc.xml
==============================================================================
--- trunk/src/ru/book/appc.xml (original)
+++ trunk/src/ru/book/appc.xml Sun Jul 31 12:46:51 2005
@@ -4,9 +4,6 @@
<title>Third Party Tools</title>
@ENGLISH }}} -->
<title>Инструменты от сторонних разработчиков</title>
- <appendixinfo>
- <edition>1575</edition>
- </appendixinfo>
<!-- See also svn.preface.organization -->
<simplesect>
Modified: trunk/src/ru/book/ch00.xml
==============================================================================
--- trunk/src/ru/book/ch00.xml (original)
+++ trunk/src/ru/book/ch00.xml Sun Jul 31 12:46:51 2005
@@ -3,9 +3,6 @@
<!-- @ENGLISH {{{
<title>Preface</title>
@ENGLISH }}} -->
- <prefaceinfo>
- <edition>1575</edition>
- </prefaceinfo>
<title>Об этой книге</title>
<simplesect>
Modified: trunk/src/ru/book/ch01.xml
==============================================================================
--- trunk/src/ru/book/ch01.xml (original)
+++ trunk/src/ru/book/ch01.xml Sun Jul 31 12:46:51 2005
@@ -6,7 +6,6 @@
@ENGLISH }}} -->
<title>Введение</title>
<chapterinfo>
- <edition>1575</edition>
<othername id="svn.intro.architecure.dia-1.prepositional-case"
role="title-variant">рисунке 1.1, «Архитектура
Subversion»</othername>
Modified: trunk/src/ru/book/ch02.xml
==============================================================================
--- trunk/src/ru/book/ch02.xml (original)
+++ trunk/src/ru/book/ch02.xml Sun Jul 31 12:46:51 2005
@@ -7,7 +7,6 @@
<title>Основные понятия</title>
<chapterinfo>
<!-- See also svn.preface.organization -->
- <edition>1575</edition>
<othername id="svn.basic.accusative-case" role="title-variant">главу
2, «Основные понятия»</othername>
</chapterinfo>
@@ -1343,6 +1342,7 @@
сами по себе являются версионироваными, делает это еще более сложным
для понимания.</para>
+ <!-- @ENGLISH {{{
<para>For example, suppose you have a working copy entirely at
revision 10. You edit the
file <filename>foo.html</filename> and then perform
@@ -1365,6 +1365,29 @@
revision 10. Only by running <command>svn update</command>
can the latest changes be downloaded, and the whole working
copy be marked as revision 15.</para>
+ @ENGLISH }}} -->
+ <para>Допустим, есть рабочая копия, полностью соответствуящая
+ правке 10. Редактируется файл <filename>foo.html</filename>,
+ после чего выполняется команда <command>svn commit</command>,
+ которая создает в хранилище правку 15. После выполнения
+ фиксации большинство новых пользователей ожидают, что вся
+ рабочая копия будет иметь правку 15, однако это не тот случай.
+ Между правками 10 и 15 в хранилище могло быть внесено любое
+ количество изменений. Клиент этого просто не знает и будет
+ неправдой заявить, что рабочая копия будет иметь правку 15.
+ С другой стороны, если <command>svn commit</command> будет
+ автоматически загружать последние изменения, то тогда для
+ всей рабочей копии можно назначить соответствие правки 15
+ — но тем самым нарушится фундаментальное правило,
+ согласно которому <quote>выталкивание</quote> и
+ <quote>затаскивание</quote> являются независимыми операциями.
+ Следовательно, все, что может сделать Subversion клиент, это
+ пометить один файл — <filename>foo.html</filename> —
+ как соответствующий правке 15. Остальная рабочая копия
+ продолжает соответствовать правке 10. Только при выполнении
+ <command>svn update</command> будут загружены последние
+ изменения и вся рабочая копия будет помечена как соответствующая
+ правке 15.</para>
</sect3>
Modified: trunk/src/ru/book/ch03.xml
==============================================================================
--- trunk/src/ru/book/ch03.xml (original)
+++ trunk/src/ru/book/ch03.xml Sun Jul 31 12:46:51 2005
@@ -5,9 +5,6 @@
<title>Guided Tour</title>
@ENGLISH }}} -->
<title>Экскурсия по Subversion</title>
- <chapterinfo>
- <edition>1575</edition>
- </chapterinfo>
<!-- See also svn.preface.organization -->
<simplesect>
Modified: trunk/src/ru/book/ch04.xml
==============================================================================
--- trunk/src/ru/book/ch04.xml (original)
+++ trunk/src/ru/book/ch04.xml Sun Jul 31 12:46:51 2005
@@ -4,9 +4,6 @@
<title>Branching and Merging</title>
@ENGLISH }}} -->
<title>Ветвление и слияние</title>
- <chapterinfo>
- <edition>1575</edition>
- </chapterinfo>
<!-- See also svn.preface.organization -->
<simplesect>
Modified: trunk/src/ru/book/ch05.xml
==============================================================================
--- trunk/src/ru/book/ch05.xml (original)
+++ trunk/src/ru/book/ch05.xml Sun Jul 31 12:46:51 2005
@@ -4,9 +4,6 @@
<title>Repository Administration</title>
@ENGLISH }}} -->
<title>Администрирование хранилища</title>
- <chapterinfo>
- <edition>1575</edition>
- </chapterinfo>
<!-- See also svn.preface.organization -->
<simplesect>
Modified: trunk/src/ru/book/ch06.xml
==============================================================================
--- trunk/src/ru/book/ch06.xml (original)
+++ trunk/src/ru/book/ch06.xml Sun Jul 31 12:46:51 2005
@@ -5,9 +5,6 @@
<title>Server Configuration</title>
@ENGLISH }}} -->
<title>Настройка сервера</title>
- <chapterinfo>
- <edition>1575</edition>
- </chapterinfo>
<!-- See also svn.preface.organization -->
<simplesect>
Modified: trunk/src/ru/book/ch07.xml
==============================================================================
--- trunk/src/ru/book/ch07.xml (original)
+++ trunk/src/ru/book/ch07.xml Sun Jul 31 12:46:51 2005
@@ -5,9 +5,6 @@
<title>Advanced Topics</title>
@ENGLISH }}} -->
<title>Профессиональное использование Subversion</title>
- <chapterinfo>
- <edition>1575</edition>
- </chapterinfo>
<!-- See also svn.preface.organization -->
<simplesect>
@@ -2460,18 +2457,18 @@
<sidebar>
<title>The "peg-revision" algorithm</title>
-
+
<para>When the commandline client sees a command of the
form:</para>
<screen>
$ svn <replaceable>command</replaceable> -r <replaceable>OPERATIVE-REV</replaceable> item@<replaceable>PEG-REV</replaceable>
</screen>
-
+
<para>...it performs the following algorithm:</para>
<itemizedlist>
-
+
<listitem>
<para>Go to revision <replaceable>PEG-REV</replaceable>, and
find <replaceable>item</replaceable>. This locates a unique
@@ -2495,7 +2492,7 @@
<para>Remember that even when you don't explicitly supply a
peg-revision, it's still present. It defaults to BASE for
working copy items, and to HEAD for URLs.</para>
-
+
</sidebar>
<para>Say that long ago we created our repository, and in revision 1
Modified: trunk/src/ru/book/ch08.xml
==============================================================================
--- trunk/src/ru/book/ch08.xml (original)
+++ trunk/src/ru/book/ch08.xml Sun Jul 31 12:46:51 2005
@@ -5,9 +5,6 @@
<title>Developer Information</title>
@ENGLISH }}} -->
<title>Информация для разработчиков</title>
- <chapterinfo>
- <edition>1575</edition>
- </chapterinfo>
<!-- See also svn.preface.organization -->
<simplesect>
Modified: trunk/src/ru/book/ch09.xml
==============================================================================
--- trunk/src/ru/book/ch09.xml (original)
+++ trunk/src/ru/book/ch09.xml Sun Jul 31 12:46:51 2005
@@ -5,9 +5,6 @@
<title>Subversion Complete Reference</title>
@ENGLISH }}} -->
<title>Полное справочное руководство по Subversion</title>
- <chapterinfo>
- <edition>1530</edition>
- </chapterinfo>
<!-- See also svn.preface.organization -->
<!-- @ENGLISH {{{
@@ -597,7 +594,7 @@
<term><option>--no-ignore</option></term>
<listitem>
<para>Показывает файлы в статусном списке, которых были бы
- пропущены как подподающие под шаблон конфигурационного свойства
+ пропущены как подподающие под шаблон конфигурационного свойства
<literal>global-ignores</literal> или свойства
<literal>svn:ignore</literal>. Смотри <xref
linkend="svn.advanced.confarea.opts.config"/> и <xref
Modified: trunk/src/ru/book/foreword.xml
==============================================================================
--- trunk/src/ru/book/foreword.xml (original)
+++ trunk/src/ru/book/foreword.xml Sun Jul 31 12:46:51 2005
@@ -8,9 +8,6 @@
<!-- @ENGLISH {{{
<title>Foreword</title>
@ENGLISH }}} -->
- <prefaceinfo>
- <edition>1575</edition>
- </prefaceinfo>
<title>Предисловие</title>
<simplesect>
Modified: trunk/src/ru/sync.py
==============================================================================
--- trunk/src/ru/sync.py (original)
+++ trunk/src/ru/sync.py Sun Jul 31 12:46:51 2005
@@ -2,6 +2,11 @@
import sys, os, string, getopt, re, glob
+bfiles = ['appa.xml', 'appb.xml', 'appc.xml', 'book.xml', 'ch00.xml', \
+ 'ch01.xml', 'ch02.xml', 'ch03.xml', 'ch04.xml', 'ch05.xml', \
+ 'ch06.xml', 'ch07.xml', 'ch08.xml', 'ch09.xml', 'copyright.xml', \
+ 'foreword.xml', 'styles.css']
+
def usage(err_msg):
stream = err_msg and sys.stderr or sys.stdout
if err_msg:
@@ -15,22 +20,10 @@
sys.exit(err_msg and 1 or 0)
def get_last(fname):
- f = file(fname)
- for line in f:
- if re.search('<edition>([0-9]+)</edition>', line):
- return int(re.sub(' *</*[a-z]*>', '', line))
+ return int(os.popen('svn propget last-sync '+fname).readline())
def set_last(fname, last):
- f = file(fname)
- tf = file(fname+'.temp', 'w')
- for line in f:
- if re.search('<edition>([0-9]+)</edition>', line):
- tf.write(re.sub('<edition>([0-9]+)</edition>', '<edition>'+last+'</edition>', line))
- else:
- tf.write(line)
- f.close()
- tf.close()
- os.rename(fname+'.temp', fname)
+ os.system('svn propset last-sync '+last+' '+fname)
def get_base():
for line in os.popen('svn info'):
@@ -38,17 +31,15 @@
return int(re.sub('Revision: ', '', line))
def get_list():
- fnames = glob.glob('*.xml')
- fnames.sort()
+ global bfiles
frlist = ()
rmin = 0xffffffff
rbase = get_base() + 1
- for file in fnames:
+ for file in bfiles:
rev = get_last(file)
- if rev:
- if rev < rmin:
- rmin = rev
- frlist += (file, rev),
+ if rev < rmin:
+ rmin = rev
+ frlist += (file, rev),
rdelta1 = rmin + ((rbase - rmin) / 3)
rdelta2 = rbase - ((rbase - rmin) / 3)
for f, r in frlist:
@@ -60,6 +51,7 @@
print '\x1b[31m', f, '\t', r, '\x1b[0m'
def main():
+ global bfiles
if len(sys.argv) < 2:
usage(None)
os.chdir('book')
@@ -70,7 +62,11 @@
fname = ''
for o, a in opts:
if o == '-f':
- fname = os.path.basename(a)
+ a = os.path.basename(a)
+ if a in bfiles:
+ fname = a
+ else:
+ usage('Invalid syntax')
elif o == '-l':
return get_list()
cmd = string.Template('svn $a -r $r1:$r2 https://svn.red-bean.com/svnbook/trunk/src/en/book/$t')
@@ -80,11 +76,11 @@
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()
if len(diff) != 0:
- print os.popen(cmd.substitute(a='log', r1=last, r2=base, t=fname)).read()
+ os.system(cmd.substitute(a='log', r1=last, r2=base, t=fname))
raw_input('Above is log message, to see diff press ENTER')
print diff
- print os.popen(cmd.substitute(a='merge', r1=last, r2=base, t=fname)).read()
+ os.system(cmd.substitute(a='merge', r1=last, r2=base, t=fname))
set_last(fname, str(base))
if __name__ == "__main__":
- main()
+ main()
More information about the svnbook-dev
mailing list