Rev 2709: Merge bzr.dev, dropping FileNames for a trivial GraphIndex layer. in http://people.ubuntu.com/~robertc/baz2.0/repository
Robert Collins
robertc at robertcollins.net
Wed Aug 8 23:58:47 BST 2007
At http://people.ubuntu.com/~robertc/baz2.0/repository
------------------------------------------------------------
revno: 2709
revision-id: robertc at robertcollins.net-20070808225838-lsunduwb1okzrexn
parent: robertc at robertcollins.net-20070808051726-vox41bt88fj2z2r2
parent: pqm at pqm.ubuntu.com-20070808195203-8j0f3kmhde2akrhx
committer: Robert Collins <robertc at robertcollins.net>
branch nick: repository
timestamp: Thu 2007-08-09 08:58:38 +1000
message:
Merge bzr.dev, dropping FileNames for a trivial GraphIndex layer.
removed:
bzrlib/file_names.py file_collection.py-20070714100753-j2zz4ahtk331k5zm-1
bzrlib/tests/test_file_names.py test_file_collection-20070714093417-5gc9d821to85zo4t-1
modified:
Makefile Makefile-20050805140406-d96e3498bb61c5bb
NEWS NEWS-20050323055033-4e00b5db738777ff
bzrlib/builtins.py builtins.py-20050830033751-fc01482b9ca23183
bzrlib/commands.py bzr.py-20050309040720-d10f4714595cf8c3
bzrlib/repofmt/knitrepo.py knitrepo.py-20070206081537-pyy4a00xdas0j4pf-1
bzrlib/tests/__init__.py selftest.py-20050531073622-8d0e3c8845c97a64
bzrlib/tests/test_repository.py test_repository.py-20060131075918-65c555b881612f4d
bzrlib/tests/workingtree_implementations/test_is_ignored.py test_is_ignored.py-20060518083307-a5b383dd4d070083
bzrlib/workingtree.py workingtree.py-20050511021032-29b6ec0a681e02e3
bzrlib/workingtree_4.py workingtree_4.py-20070208044105-5fgpc5j3ljlh5q6c-1
doc/default.css default.css-20060622101119-tgwtdci8z769bjb9-1
tools/doc_generate/autodoc_rstx.py autodoc_rstx.py-20060420024836-3e0d4a526452193c
tools/rst2html.py rst2html.py-20060817120932-gn177u8v0008txhu-1
------------------------------------------------------------
revno: 2592.1.25.2.7.1.28.1.6.1.3.1.9.2.1.3.15
revision-id: pqm at pqm.ubuntu.com-20070808195203-8j0f3kmhde2akrhx
parent: pqm at pqm.ubuntu.com-20070808113110-acathx9d9mpfo80z
parent: abentley at panoramicfeedback.com-20070808185624-0tf8gv49z90sjou4
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Wed 2007-08-08 20:52:03 +0100
message:
Fix ignore caching across unlocks (#129694, Daniel Watkins)
modified:
NEWS NEWS-20050323055033-4e00b5db738777ff
bzrlib/tests/workingtree_implementations/test_is_ignored.py test_is_ignored.py-20060518083307-a5b383dd4d070083
bzrlib/workingtree.py workingtree.py-20050511021032-29b6ec0a681e02e3
bzrlib/workingtree_4.py workingtree_4.py-20070208044105-5fgpc5j3ljlh5q6c-1
------------------------------------------------------------
revno: 2592.1.25.2.7.1.28.1.6.1.3.1.9.2.1.3.14.1.1
revision-id: abentley at panoramicfeedback.com-20070808185624-0tf8gv49z90sjou4
parent: pqm at pqm.ubuntu.com-20070808113110-acathx9d9mpfo80z
parent: d.m.watkins at warwick.ac.uk-20070801182648-x2l0w5p43ihajm8p
committer: Aaron Bentley <abentley at panoramicfeedback.com>
branch nick: Aaron's integration
timestamp: Wed 2007-08-08 14:56:24 -0400
message:
Fix ignore caching across unlocks (#129694, Daniel Watkins)
modified:
NEWS NEWS-20050323055033-4e00b5db738777ff
bzrlib/tests/workingtree_implementations/test_is_ignored.py test_is_ignored.py-20060518083307-a5b383dd4d070083
bzrlib/workingtree.py workingtree.py-20050511021032-29b6ec0a681e02e3
bzrlib/workingtree_4.py workingtree_4.py-20070208044105-5fgpc5j3ljlh5q6c-1
------------------------------------------------------------
revno: 2592.1.25.2.7.1.28.1.6.1.3.1.4.3.4
revision-id: d.m.watkins at warwick.ac.uk-20070801182648-x2l0w5p43ihajm8p
parent: d.m.watkins at warwick.ac.uk-20070801182329-vf71f4u36kibs0n0
committer: Daniel Watkins <D.M.Watkins at warwick.ac.uk>
branch nick: 129694
timestamp: Wed 2007-08-01 19:26:48 +0100
message:
The cache of ignore definitions is now cleared in WorkingTree.unlock() so that changes to .bzrignore aren't missed, fixing bug #129694.
modified:
NEWS NEWS-20050323055033-4e00b5db738777ff
------------------------------------------------------------
revno: 2592.1.25.2.7.1.28.1.6.1.3.1.4.3.3
revision-id: d.m.watkins at warwick.ac.uk-20070801182329-vf71f4u36kibs0n0
parent: d.m.watkins at warwick.ac.uk-20070801182222-z4u26hxqji4y2qvr
committer: Daniel Watkins <D.M.Watkins at warwick.ac.uk>
branch nick: 129694
timestamp: Wed 2007-08-01 19:23:29 +0100
message:
Added _cleanup() to the unlock() method of all implementations of WorkingTree so that the cached ignore definitions are wiped when a lock is lost.
modified:
bzrlib/workingtree.py workingtree.py-20050511021032-29b6ec0a681e02e3
bzrlib/workingtree_4.py workingtree_4.py-20070208044105-5fgpc5j3ljlh5q6c-1
------------------------------------------------------------
revno: 2592.1.25.2.7.1.28.1.6.1.3.1.4.3.2
revision-id: d.m.watkins at warwick.ac.uk-20070801182222-z4u26hxqji4y2qvr
parent: d.m.watkins at warwick.ac.uk-20070801182144-si0ima8ucee99vev
committer: Daniel Watkins <D.M.Watkins at warwick.ac.uk>
branch nick: 129694
timestamp: Wed 2007-08-01 19:22:22 +0100
message:
Created _cleanup() method in WorkingTree.
modified:
bzrlib/workingtree.py workingtree.py-20050511021032-29b6ec0a681e02e3
------------------------------------------------------------
revno: 2592.1.25.2.7.1.28.1.6.1.3.1.4.3.1
revision-id: d.m.watkins at warwick.ac.uk-20070801182144-si0ima8ucee99vev
parent: pqm at pqm.ubuntu.com-20070801000518-wyeivv59zhkh9cbp
committer: Daniel Watkins <D.M.Watkins at warwick.ac.uk>
branch nick: 129694
timestamp: Wed 2007-08-01 19:21:44 +0100
message:
Added test to ensure that WorkingTree.unknowns() will return an accurate list of unknown files (by way of ensuring that the cached list of ignore definitions in WorkingTree is kept up to date).
modified:
bzrlib/tests/workingtree_implementations/test_is_ignored.py test_is_ignored.py-20060518083307-a5b383dd4d070083
------------------------------------------------------------
revno: 2592.1.25.2.7.1.28.1.6.1.3.1.9.2.1.3.14
revision-id: pqm at pqm.ubuntu.com-20070808113110-acathx9d9mpfo80z
parent: pqm at pqm.ubuntu.com-20070808055516-ml9ucjsb4idmpmww
parent: bialix at ukr.net-20070807193311-76klhk4sldylzucs
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Wed 2007-08-08 12:31:10 +0100
message:
IE-safe bzr_man.html, cross-reference links for `see also' topics
(bialix,r=john,r=ian)
modified:
Makefile Makefile-20050805140406-d96e3498bb61c5bb
bzrlib/builtins.py builtins.py-20050830033751-fc01482b9ca23183
bzrlib/commands.py bzr.py-20050309040720-d10f4714595cf8c3
doc/default.css default.css-20060622101119-tgwtdci8z769bjb9-1
tools/doc_generate/autodoc_rstx.py autodoc_rstx.py-20060420024836-3e0d4a526452193c
tools/rst2html.py rst2html.py-20060817120932-gn177u8v0008txhu-1
------------------------------------------------------------
revno: 2592.1.25.2.7.1.28.1.6.1.3.1.9.2.1.3.6.1.5
revision-id: bialix at ukr.net-20070807193311-76klhk4sldylzucs
parent: bialix at ukr.net-20070807191838-1jk304202cbcmu55
parent: pqm at pqm.ubuntu.com-20070807191900-kuqpkgh4sq9fczil
committer: Alexander Belchenko <bialix at ukr.net>
branch nick: bzr_man
timestamp: Tue 2007-08-07 22:33:11 +0300
message:
merge bzr.dev
renamed:
doc/developers/HACKING => doc/developers/HACKING.txt HACKING-20050805200004-2a5dc975d870f78c
modified:
.bzrignore bzrignore-20050311232317-81f7b71efa2db11a
Makefile Makefile-20050805140406-d96e3498bb61c5bb
NEWS NEWS-20050323055033-4e00b5db738777ff
doc/developers/bundles.txt bundles.txt-20070621030528-qkjnugd7iyud6ow3-1
doc/developers/index.txt index.txt-20070508041241-qznziunkg0nffhiw-1
doc/http_smart_server.txt fastcgi.txt-20061005091552-rz8pva0olkxv0sd8-3
doc/index.txt index.txt-20060622101119-tgwtdci8z769bjb9-2
setup.py setup.py-20050314065409-02f8a0a6e3f9bc70
tools/win32/bzr-win32-bdist-postinstall.py bzrwin32bdistpostinstall.py-20060629085133-098bsfj3va8jc0ql-1
tools/win32/bzr.iss.cog bzr.iss.cog-20060622100836-b3yup582rt3y0nvm-5
doc/developers/HACKING.txt HACKING-20050805200004-2a5dc975d870f78c
------------------------------------------------------------
revno: 2592.1.25.2.7.1.28.1.6.1.3.1.9.2.1.3.6.1.4
revision-id: bialix at ukr.net-20070807191838-1jk304202cbcmu55
parent: bialix at ukr.net-20070807153415-6eb61r4qxcqbo82n
committer: Alexander Belchenko <bialix at ukr.net>
branch nick: bzr_man
timestamp: Tue 2007-08-07 22:18:38 +0300
message:
fixes after John's review
modified:
bzrlib/commands.py bzr.py-20050309040720-d10f4714595cf8c3
tools/doc_generate/autodoc_rstx.py autodoc_rstx.py-20060420024836-3e0d4a526452193c
------------------------------------------------------------
revno: 2592.1.25.2.7.1.28.1.6.1.3.1.9.2.1.3.6.1.3
revision-id: bialix at ukr.net-20070807153415-6eb61r4qxcqbo82n
parent: bialix at ukr.net-20070807152902-rqn8su318xq3jkwl
committer: Alexander Belchenko <bialix at ukr.net>
branch nick: bzr_man
timestamp: Tue 2007-08-07 18:34:15 +0300
message:
update credits
modified:
tools/doc_generate/autodoc_rstx.py autodoc_rstx.py-20060420024836-3e0d4a526452193c
------------------------------------------------------------
revno: 2592.1.25.2.7.1.28.1.6.1.3.1.9.2.1.3.6.1.2
revision-id: bialix at ukr.net-20070807152902-rqn8su318xq3jkwl
parent: bialix at ukr.net-20070807145650-jq9ss66genvith0n
committer: Alexander Belchenko <bialix at ukr.net>
branch nick: bzr_man
timestamp: Tue 2007-08-07 18:29:02 +0300
message:
bzr_man: see also topics as cross-reference links
modified:
bzrlib/builtins.py builtins.py-20050830033751-fc01482b9ca23183
bzrlib/commands.py bzr.py-20050309040720-d10f4714595cf8c3
tools/doc_generate/autodoc_rstx.py autodoc_rstx.py-20060420024836-3e0d4a526452193c
------------------------------------------------------------
revno: 2592.1.25.2.7.1.28.1.6.1.3.1.9.2.1.3.6.1.1
revision-id: bialix at ukr.net-20070807145650-jq9ss66genvith0n
parent: pqm at pqm.ubuntu.com-20070807082835-sxq0vmfbvsebps5z
committer: Alexander Belchenko <bialix at ukr.net>
branch nick: bzr_man
timestamp: Tue 2007-08-07 17:56:50 +0300
message:
rst2html: workaround for IE bug with id="tags"
modified:
Makefile Makefile-20050805140406-d96e3498bb61c5bb
doc/default.css default.css-20060622101119-tgwtdci8z769bjb9-1
tools/rst2html.py rst2html.py-20060817120932-gn177u8v0008txhu-1
------------------------------------------------------------
revno: 2592.1.25.2.7.1.28.1.6.1.3.1.9.2.1.3.13
revision-id: pqm at pqm.ubuntu.com-20070808055516-ml9ucjsb4idmpmww
parent: pqm at pqm.ubuntu.com-20070808033251-yml3s60hget1rj2b
parent: robertc at robertcollins.net-20070808050416-1c2u8miy1v7ij028
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Wed 2007-08-08 06:55:16 +0100
message:
(robertc) Remove the new FileNames class as it is redundant with a trivial no-refs, no-value index. (Robert Collins)
removed:
bzrlib/file_names.py file_collection.py-20070714100753-j2zz4ahtk331k5zm-1
bzrlib/tests/test_file_names.py test_file_collection-20070714093417-5gc9d821to85zo4t-1
modified:
NEWS NEWS-20050323055033-4e00b5db738777ff
bzrlib/tests/__init__.py selftest.py-20050531073622-8d0e3c8845c97a64
------------------------------------------------------------
revno: 2592.1.25.2.7.1.28.1.6.1.3.1.9.2.1.3.12.1.1
revision-id: robertc at robertcollins.net-20070808050416-1c2u8miy1v7ij028
parent: pqm at pqm.ubuntu.com-20070808033251-yml3s60hget1rj2b
committer: Robert Collins <robertc at robertcollins.net>
branch nick: integration
timestamp: Wed 2007-08-08 15:04:16 +1000
message:
(robertc) Remove the new FileNames class as it is redundant with a trivial no-refs, no-value index. (Robert Collins)
removed:
bzrlib/file_names.py file_collection.py-20070714100753-j2zz4ahtk331k5zm-1
bzrlib/tests/test_file_names.py test_file_collection-20070714093417-5gc9d821to85zo4t-1
modified:
NEWS NEWS-20050323055033-4e00b5db738777ff
bzrlib/tests/__init__.py selftest.py-20050531073622-8d0e3c8845c97a64
=== removed file 'bzrlib/file_names.py'
--- a/bzrlib/file_names.py 2007-08-06 23:49:18 +0000
+++ b/bzrlib/file_names.py 1970-01-01 00:00:00 +0000
@@ -1,92 +0,0 @@
-# Copyright (C) 2007 Canonical Ltd
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-"""A collection of file names which is persisted on a transport."""
-
-from bzrlib.lazy_import import lazy_import
-lazy_import(globals(), """
-from bzrlib import (
- errors,
- )
-""")
-
-
-class FileNames(object):
- """A collection of file names.
-
- The file names are persisted to a file on a transport, and cand be
- added, removed and initialised.
-
- The set of names are stored in a flat file, one name per line.
- New names are allocated sequentially.
- Initialisation creates an empty file.
-
- This is intended to support management of modest numbers of files in
- write-locked environments which may be read from unlistable transports.
-
- The save method must be called to cause the state to be saved to the
- transport.
-
- The load method is used to obtain a previously saved set.
-
- There is a cap in the _cap method which will error if more names are
- added than the names collection can sensibly manage. Currently this
- cap is 10000.
- """
-
- def __init__(self, transport, index_name):
- """Create a collection on transport called index_name."""
- self._transport = transport
- self._index_name = index_name
- self._names = None
- self._cap = 10000
-
- def allocate(self, name=None):
- """Allocate name in the names collection.
-
- :param name: The name to allocate.
- :raises: bzrlib.errors.DuplicateKey if the name is already allocated.
- """
- if name is not None:
- if len(self._names) >= self._cap:
- raise errors.BzrError('too many files')
- if name in self._names:
- raise errors.DuplicateKey(name)
- self._names.add(name)
- return name
-
- def initialise(self):
- """Initialise the collection."""
- self._names = set()
-
- def load(self):
- """Load the names from the transport."""
- self._names = set(self._transport.get_bytes(
- self._index_name).split('\n'))
- self._names.discard('')
-
- def names(self):
- """What are the names in this collection?"""
- return frozenset(self._names)
-
- def remove(self, name):
- """Remove name from the collection."""
- self._names.remove(name)
-
- def save(self):
- """Save the set of names."""
- self._transport.put_bytes(self._index_name, '\n'.join(self._names))
-
=== removed file 'bzrlib/tests/test_file_names.py'
--- a/bzrlib/tests/test_file_names.py 2007-08-06 23:49:18 +0000
+++ b/bzrlib/tests/test_file_names.py 1970-01-01 00:00:00 +0000
@@ -1,126 +0,0 @@
-# Copyright (C) 2007 Canonical Ltd
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-"""Tests for the FileNames class."""
-
-from bzrlib import errors
-from bzrlib.file_names import FileNames
-from bzrlib.tests import TestCaseWithMemoryTransport
-from bzrlib.transport import get_transport
-
-
-class TestFileNames(TestCaseWithMemoryTransport):
-
- def test_initialise(self):
- t = self.get_transport()
- for name in ('index', '00index'):
- names = FileNames(t, name)
- names.initialise()
- self.assertFalse(t.has(name))
- names.save()
- self.assertEqual('', t.get_bytes(name))
-
- def test_allocate_duplicate_name_errors(self):
- t = self.get_transport()
- names = FileNames(t, 'index')
- names.initialise()
- names.allocate('0')
- self.assertRaises(errors.DuplicateKey, names.allocate, '0')
-
- def test_allocate_name_does_not_error(self):
- t = self.get_transport()
- names = FileNames(t, 'index')
- names.initialise()
- names.allocate('0')
- self.assertFalse(t.has('index'))
-
- def test_allocate_two_names_succeeds(self):
- t = self.get_transport()
- names = FileNames(t, 'index')
- names.initialise()
- names.allocate('0')
- names.allocate('1')
- self.assertFalse(t.has('index'))
-
- def test_exceeding_the_allocation_cap_errors(self):
- t = self.get_transport()
- names = FileNames(t, 'index')
- names.initialise()
- names._cap = 5
- for number in xrange(5):
- name = names.allocate(str(number))
- self.assertRaises(errors.BzrError, names.allocate, '6')
-
- def test_load(self):
- t = self.get_transport()
- names = FileNames(t, 'index')
- names.initialise()
- names.allocate('0')
- names.allocate('1')
- names.save()
- names = FileNames(t, 'index')
- names.load()
- self.assertEqual(set(['0', '1']), names.names())
-
- def test_load_empty(self):
- t = self.get_transport()
- names = FileNames(t, 'index')
- names.initialise()
- names.save()
- names = FileNames(t, 'index')
- names.load()
- self.assertEqual(set(), names.names())
-
- def test_names(self):
- t = self.get_transport()
- names = FileNames(t, 'index')
- names.initialise()
- names.allocate('0')
- names.allocate('1')
- self.assertEqual(set(['0', '1']), names.names())
-
- def test_names_on_unlistable_works(self):
- t = self.get_transport()
- names = FileNames(t, 'index')
- names.initialise()
- names.allocate('0')
- names.allocate('1')
- names.save()
- names = FileNames(
- get_transport('unlistable+' + self.get_url()), 'index')
- names.load()
- self.assertEqual(set(['0', '1']), names.names())
-
- def test_remove(self):
- t = self.get_transport()
- names = FileNames(t, 'index')
- names.initialise()
- names.allocate('0')
- names.allocate('1')
- names.remove('0')
- self.assertEqual(set(['1']), names.names())
-
- def test_roundtrip_hash_name(self):
- t = self.get_transport()
- names = FileNames(t, 'index')
- names.initialise()
- names.allocate('0123456789abcdef0123456789abcdef')
- names.save()
- names = FileNames(t, 'index')
- names.load()
- self.assertEqual(set(['0123456789abcdef0123456789abcdef']),
- names.names())
-
=== modified file 'Makefile'
--- a/Makefile 2007-08-02 10:28:36 +0000
+++ b/Makefile 2007-08-07 19:33:11 +0000
@@ -101,6 +101,7 @@
bzrlib/sign_my_commits.py \
generate_docs.py \
tools/doc_generate/__init__.py \
+ tools/doc_generate/autodoc_man.py \
tools/doc_generate/autodoc_rstx.py
doc/bzr_man.txt: $(MAN_DEPENDENCIES)
@@ -123,7 +124,7 @@
# clean produced docs
clean-docs:
python tools/win32/ostools.py remove $(ALL_DOCS) \
- $(HTMLDIR) $(PRETTYDIR) doc/bzr_man.txt doc/developers/performance.png
+ $(HTMLDIR) $(PRETTYDIR) doc/bzr_man.txt
# build a png of our performance task list
=== modified file 'NEWS'
--- a/NEWS 2007-08-08 05:17:26 +0000
+++ b/NEWS 2007-08-08 22:58:38 +0000
@@ -123,6 +123,9 @@
* HTML documentation now use files extension *.html (Alexander Belchenko)
+ * The cache of ignore definitions is now cleared in WorkingTree.unlock()
+ so that changes to .bzrignore aren't missed. (#129694, Daniel Watkins)
+
LIBRARY API BREAKS:
* Deprecated dictionary ``bzrlib.option.SHORT_OPTIONS`` removed.
@@ -176,9 +179,6 @@
* New transport decorator 'unlistable+' which disables the list_dir
functionality for testing.
- * New ``file_names.FileNames`` support class which mananges names
- for unlistable transport situations. (Robert Collins)
-
* Deprecated ``change_entry`` in transform.py. (Ian Clatworthy)
* RevisionTree.get_weave is now deprecated. Tree.plan_merge is now used
=== modified file 'bzrlib/builtins.py'
--- a/bzrlib/builtins.py 2007-08-07 02:12:43 +0000
+++ b/bzrlib/builtins.py 2007-08-07 15:29:02 +0000
@@ -1253,7 +1253,7 @@
bzr commit -m 'imported project'
"""
- _see_also = ['init-repo', 'branch', 'checkout']
+ _see_also = ['init-repository', 'branch', 'checkout']
takes_args = ['location?']
takes_options = [
Option('create-prefix',
=== modified file 'bzrlib/commands.py'
--- a/bzrlib/commands.py 2007-08-07 05:24:34 +0000
+++ b/bzrlib/commands.py 2007-08-07 19:18:38 +0000
@@ -274,13 +274,16 @@
s = s[:-1]
return s
- def get_help_text(self, additional_see_also=None, plain=True):
+ def get_help_text(self, additional_see_also=None, plain=True,
+ see_also_as_links=False):
"""Return a text string with help for this command.
:param additional_see_also: Additional help topics to be
cross-referenced.
:param plain: if False, raw help (reStructuredText) is
returned instead of plain text.
+ :param see_also_as_links: if True, convert items in 'See also'
+ list to internal links (used by bzr_man rstx generator)
"""
doc = self.help()
if doc is None:
@@ -338,6 +341,17 @@
result += ':From: plugin "%s"\n' % plugin_name
see_also = self.get_see_also(additional_see_also)
if see_also:
+ if not plain and see_also_as_links:
+ see_also_links = []
+ for item in see_also:
+ if item == 'topics':
+ # topics doesn't have an independent section
+ # so don't create a real link
+ see_also_links.append(item)
+ else:
+ # Use a reST link for this entry
+ see_also_links.append("`%s`_" % (item,))
+ see_also = see_also_links
result += ':See also: '
result += ', '.join(see_also) + '\n'
@@ -389,7 +403,7 @@
return self.name()
def get_see_also(self, additional_terms=None):
- """Return a list of help topics that are related to this ommand.
+ """Return a list of help topics that are related to this command.
The list is derived from the content of the _see_also attribute. Any
duplicates are removed and the result is in lexical order.
=== modified file 'bzrlib/repofmt/knitrepo.py'
--- a/bzrlib/repofmt/knitrepo.py 2007-08-08 05:17:26 +0000
+++ b/bzrlib/repofmt/knitrepo.py 2007-08-08 22:58:38 +0000
@@ -19,11 +19,11 @@
import md5
from bzrlib import (
- file_names,
pack,
)
from bzrlib.index import (
GraphIndex,
+ GraphIndexBuilder,
InMemoryGraphIndex,
CombinedGraphIndex,
GraphIndexPrefixAdapter,
@@ -299,21 +299,26 @@
def ensure_loaded(self):
if self._names is None:
- self._names = file_names.FileNames(self.transport, 'index')
- self._names.load()
+ self._names = set(node[1][0] for node in
+ GraphIndex(self.transport, 'index').iter_all_entries())
def allocate(self, name):
- return self._names.allocate(name)
+ if name in self._names:
+ raise errors.DuplicateKey(name)
+ self._names.add(name)
def names(self):
"""Provide an order to the underlying names."""
- return sorted(self._names.names())
+ return sorted(self._names)
def reset(self):
self._names = None
def save(self):
- return self._names.save()
+ builder = GraphIndexBuilder()
+ for name in self._names:
+ builder.add_node((name, ), '')
+ self.transport.put_file('index', builder.finish())
def setup(self):
# cannot add names if we're not in a 'write lock'.
@@ -1193,10 +1198,8 @@
repo_transport.mkdir('packs')
repo_transport.mkdir('upload')
repo_transport.rmdir('knits')
- names = file_names.FileNames(
- repo_transport.clone('indices'), 'index')
- names.initialise()
- names.save()
+ builder = GraphIndexBuilder()
+ repo_transport.clone('indices').put_file('index', builder.finish())
for knit in ('inventory', 'revisions', 'signatures'):
repo_transport.delete(knit + '.kndx')
repo_transport.delete(knit + '.knit')
=== modified file 'bzrlib/tests/__init__.py'
--- a/bzrlib/tests/__init__.py 2007-08-08 05:17:26 +0000
+++ b/bzrlib/tests/__init__.py 2007-08-08 22:58:38 +0000
@@ -2288,7 +2288,6 @@
'bzrlib.tests.test_escaped_store',
'bzrlib.tests.test_extract',
'bzrlib.tests.test_fetch',
- 'bzrlib.tests.test_file_names',
'bzrlib.tests.test_ftp_transport',
'bzrlib.tests.test_generate_docs',
'bzrlib.tests.test_generate_ids',
=== modified file 'bzrlib/tests/test_repository.py'
--- a/bzrlib/tests/test_repository.py 2007-08-07 00:47:47 +0000
+++ b/bzrlib/tests/test_repository.py 2007-08-08 22:58:38 +0000
@@ -34,7 +34,7 @@
UnknownFormatError,
UnsupportedFormatError,
)
-from bzrlib.file_names import FileNames
+from bzrlib.index import GraphIndex
from bzrlib.repository import RepositoryFormat
from bzrlib.tests import TestCase, TestCaseWithTransport
from bzrlib.transport import get_transport
@@ -548,9 +548,8 @@
self.assertHasNoKnit(t, 'signatures')
self.assertFalse(t.has('knits'))
# revision-indexes file-container directory
- names = FileNames(t.clone('indices'), 'index')
- names.load()
- self.assertEqual(set(), names.names())
+ self.assertEqual([],
+ list(GraphIndex(t.clone('indices'), 'index').iter_all_entries()))
self.assertTrue(S_ISDIR(t.stat('packs').st_mode))
self.assertTrue(S_ISDIR(t.stat('upload').st_mode))
@@ -597,13 +596,12 @@
format = self.get_format()
tree = self.make_branch_and_tree('.', format=format)
trans = tree.branch.repository.bzrdir.get_repository_transport(None)
- names = FileNames(trans.clone('indices'), 'index')
- names.load()
- self.assertEqual(0, len(names.names()))
+ self.assertEqual([],
+ list(GraphIndex(trans.clone('indices'), 'index').iter_all_entries()))
tree.commit('foobarbaz')
- names.load()
- self.assertEqual(1, len(names.names()))
- name = list(names.names())[0]
+ index = GraphIndex(trans.clone('indices'), 'index')
+ self.assertEqual(1, len(list(index.iter_all_entries())))
+ name = list(index.iter_all_entries())[0][1][0]
self.assertTrue(trans.has('indices/%s.rix' % name))
def test_add_revision_creates_dot_six(self):
@@ -611,13 +609,12 @@
format = self.get_format()
tree = self.make_branch_and_tree('.', format=format)
trans = tree.branch.repository.bzrdir.get_repository_transport(None)
- names = FileNames(trans.clone('indices'), 'index')
- names.load()
- self.assertEqual(0, len(names.names()))
+ self.assertEqual([],
+ list(GraphIndex(trans.clone('indices'), 'index').iter_all_entries()))
tree.commit('foobarbaz')
- names.load()
- self.assertEqual(1, len(names.names()))
- name = list(names.names())[0]
+ index = GraphIndex(trans.clone('indices'), 'index')
+ self.assertEqual(1, len(list(index.iter_all_entries())))
+ name = list(index.iter_all_entries())[0][1][0]
self.assertTrue(trans.has('indices/%s.six' % name))
def test_add_revision_creates_dot_iix(self):
@@ -625,13 +622,12 @@
format = self.get_format()
tree = self.make_branch_and_tree('.', format=format)
trans = tree.branch.repository.bzrdir.get_repository_transport(None)
- names = FileNames(trans.clone('indices'), 'index')
- names.load()
- self.assertEqual(0, len(names.names()))
+ self.assertEqual([],
+ list(GraphIndex(trans.clone('indices'), 'index').iter_all_entries()))
tree.commit('foobarbaz')
- names.load()
- self.assertEqual(1, len(names.names()))
- name = list(names.names())[0]
+ index = GraphIndex(trans.clone('indices'), 'index')
+ self.assertEqual(1, len(list(index.iter_all_entries())))
+ name = list(index.iter_all_entries())[0][1][0]
self.assertTrue(trans.has('indices/%s.iix' % name))
def test_add_revision_creates_dot_tix(self):
@@ -639,13 +635,12 @@
format = self.get_format()
tree = self.make_branch_and_tree('.', format=format)
trans = tree.branch.repository.bzrdir.get_repository_transport(None)
- names = FileNames(trans.clone('indices'), 'index')
- names.load()
- self.assertEqual(0, len(names.names()))
+ self.assertEqual([],
+ list(GraphIndex(trans.clone('indices'), 'index').iter_all_entries()))
tree.commit('foobarbaz')
- names.load()
- self.assertEqual(1, len(names.names()))
- name = list(names.names())[0]
+ index = GraphIndex(trans.clone('indices'), 'index')
+ self.assertEqual(1, len(list(index.iter_all_entries())))
+ name = list(index.iter_all_entries())[0][1][0]
self.assertTrue(trans.has('indices/%s.tix' % name))
def test_pulling_nothing_leads_to_no_new_names(self):
@@ -654,9 +649,8 @@
tree2 = self.make_branch_and_tree('2', format=format)
tree1.branch.repository.fetch(tree2.branch.repository)
trans = tree1.branch.repository.bzrdir.get_repository_transport(None)
- names = FileNames(trans.clone('indices'), 'index')
- names.load()
- self.assertEqual(set(), names.names())
+ self.assertEqual([],
+ list(GraphIndex(trans.clone('indices'), 'index').iter_all_entries()))
class TestExperimentalSubtrees(TestExperimentalNoSubtrees):
=== modified file 'bzrlib/tests/workingtree_implementations/test_is_ignored.py'
--- a/bzrlib/tests/workingtree_implementations/test_is_ignored.py 2006-12-08 12:59:11 +0000
+++ b/bzrlib/tests/workingtree_implementations/test_is_ignored.py 2007-08-01 18:21:44 +0000
@@ -206,3 +206,15 @@
self.assertEqual('./foobar.py', tree.is_ignored('foobar.py'))
finally:
ignores._runtime_ignores = orig_runtime
+
+ def test_ignore_caching(self):
+ tree = self.make_branch_and_tree('.')
+ self.build_tree(['ignoreme'])
+
+ self.assertEqual(None, tree.is_ignored('ignoreme'))
+
+ # Bug #129694 specifically references WorkingTree.unknowns()
+ tree.unknowns()
+
+ self.build_tree_contents([('.bzrignore', 'ignoreme')])
+ self.assertEqual('ignoreme', tree.is_ignored('ignoreme'))
=== modified file 'bzrlib/workingtree.py'
--- a/bzrlib/workingtree.py 2007-07-25 21:25:00 +0000
+++ b/bzrlib/workingtree.py 2007-08-01 18:23:29 +0000
@@ -399,6 +399,9 @@
# the basis tree is a ghost so return an empty tree.
return self.branch.repository.revision_tree(None)
+ def _cleanup(self):
+ self._flush_ignore_list_cache()
+
@staticmethod
@deprecated_method(zero_eight)
def create(branch, directory):
@@ -2406,6 +2409,9 @@
raise
def unlock(self):
+ # do non-implementation specific cleanup
+ self._cleanup()
+
# we share control files:
if self._control_files._lock_count == 3:
# _inventory_is_modified is always False during a read lock.
@@ -2477,6 +2483,8 @@
return _mod_conflicts.ConflictList.from_stanzas(RioReader(confile))
def unlock(self):
+ # do non-implementation specific cleanup
+ self._cleanup()
if self._control_files._lock_count == 1:
# _inventory_is_modified is always False during a read lock.
if self._inventory_is_modified:
=== modified file 'bzrlib/workingtree_4.py'
--- a/bzrlib/workingtree_4.py 2007-07-20 20:27:07 +0000
+++ b/bzrlib/workingtree_4.py 2007-08-01 18:23:29 +0000
@@ -1114,6 +1114,9 @@
def unlock(self):
"""Unlock in format 4 trees needs to write the entire dirstate."""
+ # do non-implementation specific cleanup
+ self._cleanup()
+
if self._control_files._lock_count == 1:
# eventually we should do signature checking during read locks for
# dirstate updates.
=== modified file 'doc/default.css'
--- a/doc/default.css 2007-05-03 06:21:49 +0000
+++ b/doc/default.css 2007-08-07 14:56:50 +0000
@@ -144,3 +144,7 @@
color: #b52727;
text-decoration: none;
}
+
+span, th.field-name {
+ white-space: nowrap;
+}
=== modified file 'tools/doc_generate/autodoc_rstx.py'
--- a/tools/doc_generate/autodoc_rstx.py 2007-08-06 08:25:46 +0000
+++ b/tools/doc_generate/autodoc_rstx.py 2007-08-07 19:18:38 +0000
@@ -17,7 +17,7 @@
"""Generate ReStructuredText source for the User Reference Manual.
Loosely based on the manpage generator autodoc_man.py.
-Written by Alexander Belchenko and the Bazaar community.
+Written by the Bazaar community.
"""
import os
@@ -68,6 +68,20 @@
"""Build the manual part from topics matching that section."""
topics = sorted(registry.get_topics_for_section(section))
lines = [title, hdg_level1 * len(title), ""]
+
+ # docutils treats section heading as implicit link target.
+ # But in some cases topic and heading are different, e.g.:
+ #
+ # `bugs' vs. `Bug Trackers'
+ # `working-tree' vs. `Working Trees'
+ #
+ # So for building proper cross-reference between topic names
+ # and corresponding sections in document, we need provide
+ # simple glue in the form:
+ #
+ # .. _topic: `heading`_
+ links_glue = []
+
for topic in topics:
help = registry.get_detail(topic)
heading,text = help.split("\n", 1)
@@ -75,6 +89,14 @@
lines.append(hdg_level2 * len(heading))
lines.append(text)
lines.append('')
+ # check that topic match heading
+ if topic != heading.lower():
+ links_glue.append((topic, heading))
+
+ # provide links glue for topics that don't match headings
+ lines.extend([".. _%s: `%s`_" % i for i in links_glue])
+ lines.append('')
+
return "\n" + "\n".join(lines) + "\n"
@@ -88,7 +110,7 @@
if cmd_object.hidden:
continue
heading = cmd_name
- text = cmd_object.get_help_text(plain=False)
+ text = cmd_object.get_help_text(plain=False, see_also_as_links=True)
lines.append(heading)
lines.append(hdg_level2 * len(heading))
lines.append(text)
=== modified file 'tools/rst2html.py'
--- a/tools/rst2html.py 2006-08-17 12:14:57 +0000
+++ b/tools/rst2html.py 2007-08-07 14:56:50 +0000
@@ -22,4 +22,22 @@
description = ('Generates (X)HTML documents from standalone reStructuredText '
'sources. ' + default_description)
-publish_cmdline(writer_name='html', description=description)
+
+# workaround for bug with <xxx id="tags" name="tags"> in IE
+from docutils.writers import html4css1
+
+class IESafeHtmlTranslator(html4css1.HTMLTranslator):
+
+ def starttag(self, node, tagname, suffix='\n', empty=0, **attributes):
+ x = html4css1.HTMLTranslator.starttag(self, node, tagname, suffix,
+ empty, **attributes)
+ y = x.replace('id="tags"', 'id="tags_"')
+ y = y.replace('name="tags"', 'name="tags_"')
+ y = y.replace('href="#tags"', 'href="#tags_"')
+ return y
+
+mywriter = html4css1.Writer()
+mywriter.translator_class = IESafeHtmlTranslator
+
+
+publish_cmdline(writer=mywriter, description=description)
More information about the bazaar-commits
mailing list