Rev 94: Eliminate (duplicate) git_ prefix. in http://people.samba.org/bzr/jelmer/bzr-git/trunk

Jelmer Vernooij jelmer at samba.org
Sat Aug 23 14:12:11 BST 2008


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

------------------------------------------------------------
revno: 94
revision-id: jelmer at samba.org-20080823131210-lyc9ph2kyhxq5j8o
parent: jelmer at samba.org-20080823113528-73h2gi0jgpxl6arw
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: trunk
timestamp: Sat 2008-08-23 15:12:10 +0200
message:
  Eliminate (duplicate) git_ prefix.
renamed:
  git_branch.py => branch.py git_branch.py-20071108230535-su8dxk529f4uk9fx-2
  git_dir.py => dir.py git_dir.py-20071108234408-ygidvy5hviixghsd-1
  git_repository.py => repository.py git_repository.py-20071108234408-ygidvy5hviixghsd-2
  git_workingtree.py => workingtree.py git_workingtree.py-20080726200434-agakdygzl62md449-1
  tests/test_git_branch.py => tests/test_branch.py test_git_branch.py-20071108234408-ygidvy5hviixghsd-3
  tests/test_git_dir.py => tests/test_dir.py test_git_dir.py-20071108234408-ygidvy5hviixghsd-4
  tests/test_git_repository.py => tests/test_repository.py test_git_repository.-20071108234408-ygidvy5hviixghsd-5
modified:
  TODO                           TODO-20060715122516-k72e9yjw2qxzjphc-1
  __init__.py                    __init__.py-20060715102359-vayyec84yioge4ok-1
  tests/__init__.py              __init__.py-20070202180350-njrb42t7fnv35d1k-2
  dir.py                         git_dir.py-20071108234408-ygidvy5hviixghsd-1
  repository.py                  git_repository.py-20071108234408-ygidvy5hviixghsd-2
  tests/test_branch.py           test_git_branch.py-20071108234408-ygidvy5hviixghsd-3
  tests/test_dir.py              test_git_dir.py-20071108234408-ygidvy5hviixghsd-4
  tests/test_repository.py       test_git_repository.-20071108234408-ygidvy5hviixghsd-5
=== modified file 'TODO'
--- a/TODO	2007-12-26 20:07:15 +0000
+++ b/TODO	2008-08-23 13:12:10 +0000
@@ -1,10 +1,2 @@
-Todo
-====
-
-- revision inventory synthesis, a-la bzr-hg.
-- file content data access.
-- native cloning - so bzr branch fromgit togit works.
-- conversion pulling - so bzr init; bzr pull fromgit works.
-- possibly generate a factored out generic 'git' python module if our native
-  bindings become big enough.
-- TESTS
+- Push into git
+- Tests

=== modified file '__init__.py'
--- a/__init__.py	2007-12-28 20:15:51 +0000
+++ b/__init__.py	2008-08-23 13:12:10 +0000
@@ -19,7 +19,7 @@
 """A GIT branch and repository format implementation for bzr."""
 
 from bzrlib import bzrdir
-from bzrlib.plugins.git.git_dir import GitBzrDirFormat
+from bzrlib.plugins.git.dir import GitBzrDirFormat
 
 bzrdir.format_registry.register(
     'git', GitBzrDirFormat,

=== renamed file 'git_branch.py' => 'branch.py'
=== renamed file 'git_dir.py' => 'dir.py'
--- a/git_dir.py	2008-07-26 20:56:51 +0000
+++ b/dir.py	2008-08-23 13:12:10 +0000
@@ -28,9 +28,9 @@
 lazy_import(globals(), """
 from bzrlib.plugins.git import (
     errors,
-    git_branch,
-    git_repository,
-    git_workingtree,
+    branch,
+    repository,
+    workingtree,
     )
 """)
 
@@ -64,7 +64,7 @@
 class GitDir(bzrdir.BzrDir):
     """An adapter to the '.git' dir used by git."""
 
-    _gitrepository_class = git_repository.GitRepository
+    _gitrepository_class = repository.GitRepository
 
     def __init__(self, transport, lockfiles, gitrepo, format):
         self._format = format
@@ -96,7 +96,7 @@
             head = None
         else:
             head = repo._git.heads[0].commit.id
-        return git_branch.GitBranch(self, repo, head, 
+        return branch.GitBranch(self, repo, head, 
                                     self.root_transport.base, self._lockfiles)
 
     def open_repository(self, shared=False):
@@ -108,7 +108,7 @@
             loc = urlutils.unescape_for_display(self.root_transport.base, 'ascii')
             raise errors.bzr_errors.NoWorkingTree(loc)
         else:
-            return git_workingtree.GitWorkingTree(self, self.open_repository(), 
+            return workingtree.GitWorkingTree(self, self.open_repository(), 
                                                   self.open_branch())
 
     def cloning_metadir(self):

=== renamed file 'git_repository.py' => 'repository.py'
--- a/git_repository.py	2008-08-23 11:34:36 +0000
+++ b/repository.py	2008-08-23 13:12:10 +0000
@@ -35,7 +35,6 @@
 from bzrlib.transport import get_transport
 
 from bzrlib.plugins.git import (
-    cache,
     ids,
     versionedfiles
     )
@@ -51,9 +50,6 @@
         self.bzrdir = gitdir
         self.control_files = lockfiles
         self._git = gitdir._git
-        cache_dir = cache.create_cache_dir()
-        cachedir_transport = get_transport(cache_dir)
-        cache_file = os.path.join(cache_dir, 'cache-%s' % ids.NAMESPACE)
         self.texts = None
         self.signatures = versionedfiles.VirtualSignatureTexts(self)
         self.revisions = versionedfiles.VirtualRevisionTexts(self)

=== modified file 'tests/__init__.py'
--- a/tests/__init__.py	2008-07-28 01:43:48 +0000
+++ b/tests/__init__.py	2008-08-23 13:12:10 +0000
@@ -228,9 +228,9 @@
 
     testmod_names = [
         'test_builder',
-        'test_git_branch',
-        'test_git_dir',
-        'test_git_repository',
+        'test_branch',
+        'test_dir',
+        'test_repository',
         'test_ids',
         'test_blackbox',
         'test_versionedfiles',

=== renamed file 'tests/test_git_branch.py' => 'tests/test_branch.py'
--- a/tests/test_git_branch.py	2008-07-26 18:05:55 +0000
+++ b/tests/test_branch.py	2008-08-23 13:12:10 +0000
@@ -18,11 +18,12 @@
 
 import git
 
-from bzrlib import branch, revision
+from bzrlib import revision
+from bzrlib.branch import Branch
 
 from bzrlib.plugins.git import tests
 from bzrlib.plugins.git import (
-    git_branch,
+    branch,
     ids,
     )
 
@@ -34,13 +35,13 @@
     def test_open_existing(self):
         tests.run_git('init')
 
-        thebranch = branch.Branch.open('.')
-        self.assertIsInstance(thebranch, git_branch.GitBranch)
+        thebranch = Branch.open('.')
+        self.assertIsInstance(thebranch, branch.GitBranch)
 
     def test_last_revision_is_null(self):
         tests.run_git('init')
 
-        thebranch = branch.Branch.open('.')
+        thebranch = Branch.open('.')
         self.assertEqual(revision.NULL_REVISION, thebranch.last_revision())
         self.assertEqual((0, revision.NULL_REVISION),
                          thebranch.last_revision_info())
@@ -55,7 +56,7 @@
         self.simple_commit_a()
         head = tests.run_git('rev-parse', 'HEAD').strip()
 
-        thebranch = branch.Branch.open('.')
+        thebranch = Branch.open('.')
         self.assertEqual(ids.convert_revision_id_git_to_bzr(head),
                          thebranch.last_revision())
 
@@ -67,7 +68,7 @@
         tests.run_git('commit', '-m', 'b')
         revb = tests.run_git('rev-parse', 'HEAD').strip()
 
-        thebranch = branch.Branch.open('.')
+        thebranch = Branch.open('.')
         self.assertEqual([ids.convert_revision_id_git_to_bzr(r) for r in (reva, revb)],
                          thebranch.revision_history())
 
@@ -79,7 +80,7 @@
         
         newid = open('.git/refs/tags/foo').read().rstrip()
 
-        thebranch = branch.Branch.open('.')
+        thebranch = Branch.open('.')
         self.assertEquals({"foo": ids.convert_revision_id_git_to_bzr(newid)},
                           thebranch.tags.get_tag_dict())
         
@@ -89,7 +90,7 @@
     def setUp(self):
         tests.TestCaseWithTransport.setUp(self)
         git.repo.Repo.create(self.test_dir)
-        self.git_branch = branch.Branch.open(self.test_dir)
+        self.git_branch = Branch.open(self.test_dir)
 
     def test_get_parent(self):
         self.assertIs(None, self.git_branch.get_parent())
@@ -105,7 +106,7 @@
 
     def setUp(self):
         super(TestGitBranchFormat, self).setUp()
-        self.format = git_branch.GitBranchFormat()
+        self.format = branch.GitBranchFormat()
 
     def test_get_format_description(self):
         self.assertEquals("Git Branch", self.format.get_format_description())

=== renamed file 'tests/test_git_dir.py' => 'tests/test_dir.py'
--- a/tests/test_git_dir.py	2008-07-26 20:56:51 +0000
+++ b/tests/test_dir.py	2008-08-23 13:12:10 +0000
@@ -18,8 +18,7 @@
 
 from bzrlib import bzrdir, errors
 
-from bzrlib.plugins.git import tests
-from bzrlib.plugins.git import git_dir, git_workingtree
+from bzrlib.plugins.git import dir, tests, workingtree
 
 
 class TestGitDir(tests.TestCaseInTempDir):
@@ -30,14 +29,14 @@
         tests.run_git('init')
 
         gd = bzrdir.BzrDir.open('.')
-        self.assertIsInstance(gd, git_dir.GitDir)
+        self.assertIsInstance(gd, dir.GitDir)
 
     def test_open_workingtree(self):
         tests.run_git('init')
 
         gd = bzrdir.BzrDir.open('.')
         wt = gd.open_workingtree()
-        self.assertIsInstance(wt, git_workingtree.GitWorkingTree)
+        self.assertIsInstance(wt, workingtree.GitWorkingTree)
 
     def test_open_workingtree_bare(self):
         tests.run_git('--bare', 'init')
@@ -52,7 +51,7 @@
 
     def setUp(self):
         super(TestGitDirFormat, self).setUp()
-        self.format = git_dir.GitBzrDirFormat()
+        self.format = dir.GitBzrDirFormat()
 
     def test_get_format_description(self):
         self.assertEquals("Local Git Repository",

=== renamed file 'tests/test_git_repository.py' => 'tests/test_repository.py'
--- a/tests/test_git_repository.py	2008-07-26 18:58:29 +0000
+++ b/tests/test_repository.py	2008-08-23 13:12:10 +0000
@@ -21,14 +21,14 @@
 from bzrlib import (
     errors,
     inventory,
-    repository,
     revision,
     )
+from bzrlib.repository import Repository
 
 from bzrlib.plugins.git import tests
 from bzrlib.plugins.git import (
-    git_dir,
-    git_repository,
+    dir,
+    repository,
     ids,
     )
 
@@ -41,13 +41,13 @@
     def test_open_existing(self):
         tests.run_git('init')
 
-        repo = repository.Repository.open('.')
-        self.assertIsInstance(repo, git_repository.GitRepository)
+        repo = Repository.open('.')
+        self.assertIsInstance(repo, repository.GitRepository)
 
     def test_has_git_repo(self):
         tests.run_git('init')
 
-        repo = repository.Repository.open('.')
+        repo = Repository.open('.')
         self.assertIsInstance(repo._git, git.repo.Repo)
 
     def test_get_revision(self):
@@ -63,7 +63,7 @@
 
         # Get the corresponding Revision object.
         revid = ids.convert_revision_id_git_to_bzr(commit_id)
-        repo = repository.Repository.open('.')
+        repo = Repository.open('.')
         rev = repo.get_revision(revid)
         self.assertIsInstance(rev, revision.Revision)
 
@@ -83,7 +83,7 @@
     def test_revision_tree(self):
         commit_id = self.simple_commit()
         revid = ids.convert_revision_id_git_to_bzr(commit_id)
-        repo = repository.Repository.open('.')
+        repo = Repository.open('.')
         tree = repo.revision_tree(revid)
         self.assertEquals(tree.get_revision_id(), revid)
         self.assertEquals("text\n", tree.get_file_text(tree.path2id("data")))
@@ -96,7 +96,7 @@
 
         # Get the corresponding Inventory object.
         revid = ids.convert_revision_id_git_to_bzr(commit_id)
-        repo = repository.Repository.open('.')
+        repo = Repository.open('.')
         inv = repo.get_inventory(revid)
         self.assertIsInstance(inv, inventory.Inventory)
         printed_inv = '\n'.join(
@@ -126,7 +126,7 @@
     def setUp(self):
         tests.TestCaseWithTransport.setUp(self)
         git.repo.Repo.create(self.test_dir)
-        self.git_repo = repository.Repository.open(self.test_dir)
+        self.git_repo = Repository.open(self.test_dir)
 
     def test_supports_rich_root(self):
         # GitRepository.supports_rich_root is False, at least for now.
@@ -172,7 +172,7 @@
 
     def setUp(self):
         super(GitRepositoryFormat, self).setUp()
-        self.format = git_repository.GitFormat()
+        self.format = repository.GitFormat()
 
     def test_get_format_description(self):
         self.assertEquals("Git Repository", self.format.get_format_description())

=== renamed file 'git_workingtree.py' => 'workingtree.py'



More information about the bazaar-commits mailing list