Mercurial > kallithea
changeset 2543:03a770980b55 beta
Synced vcs with upstream
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Wed, 04 Jul 2012 11:42:16 +0200 |
parents | 4496d3119627 |
children | 6ce3387bf0ce |
files | rhodecode/lib/vcs/__init__.py rhodecode/lib/vcs/backends/git/changeset.py rhodecode/lib/vcs/backends/hg/changeset.py rhodecode/lib/vcs/backends/hg/inmemory.py rhodecode/lib/vcs/backends/hg/repository.py rhodecode/lib/vcs/backends/hg/workdir.py rhodecode/lib/vcs/nodes.py rhodecode/tests/vcs/test_changesets.py |
diffstat | 8 files changed, 15 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/rhodecode/lib/vcs/__init__.py Tue Jul 03 03:27:48 2012 +0200 +++ b/rhodecode/lib/vcs/__init__.py Wed Jul 04 11:42:16 2012 +0200 @@ -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]))
--- a/rhodecode/lib/vcs/backends/git/changeset.py Tue Jul 03 03:27:48 2012 +0200 +++ b/rhodecode/lib/vcs/backends/git/changeset.py Wed Jul 04 11:42:16 2012 +0200 @@ -15,7 +15,6 @@ 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 @@ 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:
--- a/rhodecode/lib/vcs/backends/hg/changeset.py Tue Jul 03 03:27:48 2012 +0200 +++ b/rhodecode/lib/vcs/backends/hg/changeset.py Wed Jul 04 11:42:16 2012 +0200 @@ -12,8 +12,7 @@ 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):
--- a/rhodecode/lib/vcs/backends/hg/inmemory.py Tue Jul 03 03:27:48 2012 +0200 +++ b/rhodecode/lib/vcs/backends/hg/inmemory.py Wed Jul 04 11:42:16 2012 +0200 @@ -4,7 +4,7 @@ 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):
--- a/rhodecode/lib/vcs/backends/hg/repository.py Tue Jul 03 03:27:48 2012 +0200 +++ b/rhodecode/lib/vcs/backends/hg/repository.py Wed Jul 04 11:42:16 2012 +0200 @@ -18,7 +18,7 @@ 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
--- a/rhodecode/lib/vcs/backends/hg/workdir.py Tue Jul 03 03:27:48 2012 +0200 +++ b/rhodecode/lib/vcs/backends/hg/workdir.py Wed Jul 04 11:42:16 2012 +0200 @@ -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):
--- a/rhodecode/lib/vcs/nodes.py Tue Jul 03 03:27:48 2012 +0200 +++ b/rhodecode/lib/vcs/nodes.py Wed Jul 04 11:42:16 2012 +0200 @@ -16,7 +16,7 @@ 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
--- a/rhodecode/tests/vcs/test_changesets.py Tue Jul 03 03:27:48 2012 +0200 +++ b/rhodecode/tests/vcs/test_changesets.py Wed Jul 04 11:42:16 2012 +0200 @@ -119,6 +119,14 @@ 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