Rev 66: Implement branch.get_parent(). in http://people.samba.org/bzr/jelmer/bzr-git/trunk

Jelmer Vernooij jelmer at samba.org
Sat Jul 26 17:27:42 BST 2008


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

------------------------------------------------------------
revno: 66
revision-id: jelmer at samba.org-20080726154015-pc36gdnim70ny61l
parent: jelmer at samba.org-20080726153741-hkexn461eiqepxht
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: trunk
timestamp: Sat 2008-07-26 17:40:15 +0200
message:
  Implement branch.get_parent().
modified:
  git_branch.py                  git_branch.py-20071108230535-su8dxk529f4uk9fx-2
  tests/test_git_branch.py       test_git_branch.py-20071108234408-ygidvy5hviixghsd-3
=== modified file 'git_branch.py'
--- a/git_branch.py	2008-07-26 15:30:41 +0000
+++ b/git_branch.py	2008-07-26 15:40:15 +0000
@@ -67,6 +67,10 @@
             return revision.NULL_REVISION
         return ids.convert_revision_id_git_to_bzr(self.head)
 
+    def get_parent(self):
+        """See Branch.get_parent()."""
+        return None
+
     def _gen_revision_history(self):
         if self.head is None:
             return []

=== modified file 'tests/test_git_branch.py'
--- a/tests/test_git_branch.py	2008-07-26 13:16:06 +0000
+++ b/tests/test_git_branch.py	2008-07-26 15:40:15 +0000
@@ -16,7 +16,7 @@
 
 """Tests for interfacing with a Git Branch"""
 
-import subprocess
+import git
 
 from bzrlib import branch, revision
 
@@ -71,3 +71,13 @@
         self.assertEqual([ids.convert_revision_id_git_to_bzr(r) for r in (reva, revb)],
                          thebranch.revision_history())
         
+
+class TestWithGitBranch(tests.TestCaseWithTransport):
+
+    def setUp(self):
+        tests.TestCaseWithTransport.setUp(self)
+        git.repo.Repo.create(self.test_dir)
+        self.git_branch = branch.Branch.open(self.test_dir)
+
+    def test_get_parent(self):
+        self.assertIs(None, self.git_branch.get_parent())




More information about the bazaar-commits mailing list