Rev 3: Create an ``index`` command (totally nonfunctional for now). in http://people.ubuntu.com/~robertc/baz2.0/plugins/search/trunk

Robert Collins robertc at robertcollins.net
Sun Jun 8 07:22:14 BST 2008


At http://people.ubuntu.com/~robertc/baz2.0/plugins/search/trunk

------------------------------------------------------------
revno: 3
revision-id: robertc at robertcollins.net-20080608062127-2gk12epf1s2ah0yg
parent: robertc at robertcollins.net-20080608055724-c6tjpycts2476brf
committer: Robert Collins <robertc at robertcollins.net>
branch nick: trunk
timestamp: Sun 2008-06-08 16:21:27 +1000
message:
  Create an ``index`` command (totally nonfunctional for now).
  (Robert Collins)
modified:
  NEWS                           news-20080608052041-z5bahsl8kwl0uf4x-2
  __init__.py                    __init__.py-20080608052041-z5bahsl8kwl0uf4x-4
  commands.py                    commands.py-20080608052041-z5bahsl8kwl0uf4x-5
  tests/test_blackbox.py         test_blackbox.py-20080608052041-z5bahsl8kwl0uf4x-9
=== modified file 'NEWS'
--- a/NEWS	2008-06-08 05:57:24 +0000
+++ b/NEWS	2008-06-08 06:21:27 +0000
@@ -13,6 +13,9 @@
 
   FEATURES:
 
+    * New command ``index`` to create a search index.
+      (Robert Collins)
+
     * New command ``search`` to search a search index from within bzr.
       (Robert Collins)
 

=== modified file '__init__.py'
--- a/__init__.py	2008-06-08 05:20:44 +0000
+++ b/__init__.py	2008-06-08 06:21:27 +0000
@@ -27,6 +27,7 @@
 
 
 for command in [
+    'index',
     'search',
     ]:
     bzrlib.commands.register_command(getattr(commands, 'cmd_' + command))

=== modified file 'commands.py'
--- a/commands.py	2008-06-08 05:57:24 +0000
+++ b/commands.py	2008-06-08 06:21:27 +0000
@@ -22,13 +22,28 @@
 from bzrlib.transport import get_transport
 
 
+class cmd_index(bzrlib.commands.Command):
+    """Create or update a search index.
+
+    This locates documents in bzr at a given url and creates a search index for
+    that url.
+    """
+
+    _see_also = ['search']
+    takes_args = ['url']
+
+    def run(self, url):
+        pass
+
+
 class cmd_search(bzrlib.commands.Command):
-    """Perform a search.
+    """Perform a search within bzr history.
 
     This locates documents that match the query and reports them to the
     console.
     """
 
+    _see_also = ['index']
     takes_args = ['query+']
 
     def run(self, query_list=[]):

=== modified file 'tests/test_blackbox.py'
--- a/tests/test_blackbox.py	2008-06-08 05:57:24 +0000
+++ b/tests/test_blackbox.py	2008-06-08 06:21:27 +0000
@@ -27,3 +27,12 @@
 
     def test_no_index_error(self):
         self.run_bzr_error(['No search index'], ['search', 'robert'])
+
+
+class TestIndex(TestCaseWithTransport):
+
+    def test_index_branch(self):
+        branch = self.make_branch('a-branch')
+        out, error = self.run_bzr(['index', 'a-branch'])
+        self.assertEqual('', error)
+        self.assertEqual('', out)




More information about the bazaar-commits mailing list