Rev 89: Support sprouting branches. in http://people.samba.org/bzr/jelmer/bzr-git/trunk

Jelmer Vernooij jelmer at samba.org
Sat Jul 26 20:13:46 BST 2008


At http://people.samba.org/bzr/jelmer/bzr-git/trunk

------------------------------------------------------------
revno: 89
revision-id: jelmer at samba.org-20080726191345-j3rrrr86bq9tb0i7
parent: jelmer at samba.org-20080726185829-y9mgj1pzeyrpmdh3
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: trunk
timestamp: Sat 2008-07-26 21:13:45 +0200
message:
  Support sprouting branches.
modified:
  git_branch.py                  git_branch.py-20071108230535-su8dxk529f4uk9fx-2
  tests/test_blackbox.py         test_blackbox.py-20071228193717-18el6d8x4qddug3w-1
=== modified file 'git_branch.py'
--- a/git_branch.py	2008-07-26 18:12:31 +0000
+++ b/git_branch.py	2008-07-26 19:13:45 +0000
@@ -28,8 +28,9 @@
 
 class GitTagDict(tag.BasicTags):
 
-    def __init__(self, repository):
-        self.repository = repository
+    def __init__(self, branch):
+        self.branch = branch
+        self.repository = branch.repository
 
     def get_tag_dict(self):
         ret = {}
@@ -86,7 +87,7 @@
         return ids.convert_revision_id_git_to_bzr(self.head)
 
     def _make_tags(self):
-        return GitTagDict(self.repository)
+        return GitTagDict(self)
 
     def get_parent(self):
         """See Branch.get_parent()."""

=== modified file 'tests/test_blackbox.py'
--- a/tests/test_blackbox.py	2008-07-26 18:12:12 +0000
+++ b/tests/test_blackbox.py	2008-07-26 19:13:45 +0000
@@ -16,6 +16,8 @@
 
 """Black-box tests for bzr-git."""
 
+import os
+
 from bzrlib.tests import KnownFailure
 from bzrlib.tests.blackbox import ExternalBase
 
@@ -41,6 +43,20 @@
         self.assertEqual(error, '')
         self.assertTrue("Repository branch (format: git)" in output)
 
+    def test_branch(self):
+        os.mkdir("gitbranch")
+        os.chdir("gitbranch")
+        tests.run_git('init')
+        builder = tests.GitBranchBuilder()
+        builder.set_file('a', 'text for a\n', False)
+        builder.commit('Joe Foo <joe at foo.com>', u'<The commit message>')
+        builder.finish()
+
+        os.chdir("..")
+        output, error = self.run_bzr(['branch', 'gitbranch', 'bzrbranch'])
+        self.assertEqual(error, 'Branched 1 revision(s).\n')
+        self.assertEqual(output, '')
+
     def test_ls(self):
         self.simple_commit()
         output, error = self.run_bzr(['ls'])




More information about the bazaar-commits mailing list