Rev 1: Initial layout of the RAF site-customization plugin. in http://bzr.arbash-meinel.com/plugins/raf

John Arbash Meinel john at arbash-meinel.com
Wed Jan 14 19:49:29 GMT 2009


At http://bzr.arbash-meinel.com/plugins/raf

------------------------------------------------------------
revno: 1
revision-id: john at arbash-meinel.com-20090114194912-el18nbx90xb8q89z
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: raf
timestamp: Wed 2009-01-14 13:49:12 -0600
message:
  Initial layout of the RAF site-customization plugin.
-------------- next part --------------
=== added file '__init__.py'
--- a/__init__.py	1970-01-01 00:00:00 +0000
+++ b/__init__.py	2009-01-14 19:49:12 +0000
@@ -0,0 +1,81 @@
+# Copyright (C) 2009 RAF
+#
+# 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
+
+"""Site customizations for the RAF group.
+
+At the moment, this just provides the "archive-branch" command, to move a
+feature branch that has been finished into the archived location.
+"""
+
+from bzrlib import (
+    commands,
+    errors,
+    option,
+    trace,
+    )
+
+version_info = (0, 1, 0, 'dev', 0)
+
+
+DEFAULT_TARGET_BRANCH = 'bzr+ssh://?????'
+
+
+class cmd_archive_branch(commands.Command):
+    """Move an existing branch into the archived location.
+
+    If you supply a URL, it will consider that the branch to be archived. If
+    you don't supply a URL, it will use the workingtree/branch in the current
+    directory. If this branch is a checkout (bound branch) then it will try to
+    archive the master branch, and point this checkout to the new location.
+
+    This will also ensure that all revisions are merged into the 'target'
+    branch before archiving the branch. If no target is specified then it
+    defaults to the 'trunk' branch.
+    """
+
+    takes_args = ['url?']
+    takes_options = [option.Option('target'),
+                     option.Option('no-check'),
+                    ]
+
+    def run(self, url=None):
+        from bzrlib import branch, workingtree
+
+        if url is None:
+            wt, relpath = workingtree.WorkingTree.open_containing('.')
+            b = wt.branch
+        else:
+            wt = None
+            b = branch.Branch.open(url)
+
+commands.register_command(cmd_archive_branch)
+
+
+def load_tests(basic_tests, module, loader):
+    suite = loader.suiteClass()
+
+    test_files = [__name__ + '.' + x for x in [
+        'test_blackbox_raf',
+        'test_raf',
+    ]]
+    suite.addTests(loader.loadTestsFromModuleNames(test_files))
+    return suite
+
+
+if not __name__.endswith('.raf'):
+    trace.warning('The raf plugin is installed into the wrong name.'
+        ' It is currently called %s, but it should be installed as'
+        ' bzrlib.plugins.raf', __name__)

=== added file 'test_blackbox_raf.py'
--- a/test_blackbox_raf.py	1970-01-01 00:00:00 +0000
+++ b/test_blackbox_raf.py	2009-01-14 19:49:12 +0000
@@ -0,0 +1,26 @@
+# Copyright (C) 2009 RAF
+#
+# 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 UI commands provided by the RAF plugin."""
+
+from bzrlib import (
+    tests,
+    )
+
+
+class TestRAF(tests.TestCaseWithTransport):
+
+    pass

=== added file 'test_raf.py'
--- a/test_raf.py	1970-01-01 00:00:00 +0000
+++ b/test_raf.py	2009-01-14 19:49:12 +0000
@@ -0,0 +1,26 @@
+# Copyright (C) 2009 RAF
+#
+# 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
+
+"""Whitebox tests of the RAF plugin functionality."""
+
+from bzrlib import (
+    tests,
+    )
+
+
+class TestRAF(tests.TestCaseWithTransport):
+
+    pass



More information about the bazaar-commits mailing list