diff --git a/rhodecode/lib/vcs/__init__.py b/rhodecode/lib/vcs/__init__.py --- a/rhodecode/lib/vcs/__init__.py +++ b/rhodecode/lib/vcs/__init__.py @@ -10,7 +10,7 @@ :copyright: (c) 2010-2011 by Marcin Kuzminski, Lukasz Balcerzak. """ -VERSION = (0, 2, 3, 'dev') +VERSION = (0, 3, 0, 'dev') __version__ = '.'.join((str(each) for each in VERSION[:4])) diff --git a/rhodecode/lib/vcs/backends/git/changeset.py b/rhodecode/lib/vcs/backends/git/changeset.py --- a/rhodecode/lib/vcs/backends/git/changeset.py +++ b/rhodecode/lib/vcs/backends/git/changeset.py @@ -15,7 +15,6 @@ from rhodecode.lib.vcs.nodes import File from rhodecode.lib.vcs.utils import safe_unicode from rhodecode.lib.vcs.utils import date_fromtimestamp from rhodecode.lib.vcs.utils.lazy import LazyProperty -from dulwich.objects import Commit, Tag class GitChangeset(BaseChangeset): @@ -29,7 +28,7 @@ class GitChangeset(BaseChangeset): try: commit = self.repository._repo.get_object(revision) - if isinstance(commit, Tag): + if isinstance(commit, objects.Tag): revision = commit.object[1] commit = self.repository._repo.get_object(commit.object[1]) except KeyError: diff --git a/rhodecode/lib/vcs/backends/hg/changeset.py b/rhodecode/lib/vcs/backends/hg/changeset.py --- a/rhodecode/lib/vcs/backends/hg/changeset.py +++ b/rhodecode/lib/vcs/backends/hg/changeset.py @@ -12,8 +12,7 @@ from rhodecode.lib.vcs.nodes import Adde from rhodecode.lib.vcs.utils import safe_str, safe_unicode, date_fromtimestamp from rhodecode.lib.vcs.utils.lazy import LazyProperty from rhodecode.lib.vcs.utils.paths import get_dirs_for_path - -from ...utils.hgcompat import archival, hex +from rhodecode.lib.vcs.utils.hgcompat import archival, hex class MercurialChangeset(BaseChangeset): diff --git a/rhodecode/lib/vcs/backends/hg/inmemory.py b/rhodecode/lib/vcs/backends/hg/inmemory.py --- a/rhodecode/lib/vcs/backends/hg/inmemory.py +++ b/rhodecode/lib/vcs/backends/hg/inmemory.py @@ -4,7 +4,7 @@ import errno from rhodecode.lib.vcs.backends.base import BaseInMemoryChangeset from rhodecode.lib.vcs.exceptions import RepositoryError -from ...utils.hgcompat import memfilectx, memctx, hex, tolocal +from rhodecode.lib.vcs.utils.hgcompat import memfilectx, memctx, hex, tolocal class MercurialInMemoryChangeset(BaseInMemoryChangeset): diff --git a/rhodecode/lib/vcs/backends/hg/repository.py b/rhodecode/lib/vcs/backends/hg/repository.py --- a/rhodecode/lib/vcs/backends/hg/repository.py +++ b/rhodecode/lib/vcs/backends/hg/repository.py @@ -18,7 +18,7 @@ from rhodecode.lib.vcs.utils.lazy import from rhodecode.lib.vcs.utils.ordered_dict import OrderedDict from rhodecode.lib.vcs.utils.paths import abspath -from ...utils.hgcompat import ui, nullid, match, patch, diffopts, clone, \ +from rhodecode.lib.vcs.utils.hgcompat import ui, nullid, match, patch, diffopts, clone, \ get_contact, pull, localrepository, RepoLookupError, Abort, RepoError, hex diff --git a/rhodecode/lib/vcs/backends/hg/workdir.py b/rhodecode/lib/vcs/backends/hg/workdir.py --- a/rhodecode/lib/vcs/backends/hg/workdir.py +++ b/rhodecode/lib/vcs/backends/hg/workdir.py @@ -1,7 +1,7 @@ from rhodecode.lib.vcs.backends.base import BaseWorkdir from rhodecode.lib.vcs.exceptions import BranchDoesNotExistError -from ...utils.hgcompat import hg_merge +from rhodecode.lib.vcs.utils.hgcompat import hg_merge class MercurialWorkdir(BaseWorkdir): diff --git a/rhodecode/lib/vcs/nodes.py b/rhodecode/lib/vcs/nodes.py --- a/rhodecode/lib/vcs/nodes.py +++ b/rhodecode/lib/vcs/nodes.py @@ -16,7 +16,7 @@ import mimetypes from pygments import lexers from rhodecode.lib.vcs.utils.lazy import LazyProperty -from rhodecode.lib.vcs.utils import safe_unicode, safe_str +from rhodecode.lib.vcs.utils import safe_unicode from rhodecode.lib.vcs.exceptions import NodeError from rhodecode.lib.vcs.exceptions import RemovedFileNodeError from rhodecode.lib.vcs.backends.base import EmptyChangeset diff --git a/rhodecode/tests/vcs/test_changesets.py b/rhodecode/tests/vcs/test_changesets.py --- a/rhodecode/tests/vcs/test_changesets.py +++ b/rhodecode/tests/vcs/test_changesets.py @@ -119,6 +119,14 @@ class ChangesetsWithCommitsTestCaseixin( branch_name=self.repo.DEFAULT_BRANCH_NAME) self.assertNotIn(doc_changeset, default_branch_changesets) + def test_get_changeset_by_branch(self): + for branch, sha in self.repo.branches.iteritems(): + self.assertEqual(sha, self.repo.get_changeset(branch).raw_id) + + def test_get_changeset_by_tag(self): + for tag, sha in self.repo.tags.iteritems(): + self.assertEqual(sha, self.repo.get_changeset(tag).raw_id) + class ChangesetsTestCaseMixin(BackendTestMixin): recreate_repo_per_test = False