We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
As the docstring say it should return the changeset of checked out workdir but it now returns the last changeset
here's the fix for it:
marcink@/home/marcink/workspace-python/vcs # hg diff -c 5b344e89bd23 [21:21:40 on 27/04/2013] diff --git a/vcs/backends/git/workdir.py b/vcs/backends/git/workdir.py --- a/vcs/backends/git/workdir.py +++ b/vcs/backends/git/workdir.py @@ -15,17 +15,17 @@ class GitWorkdir(BaseWorkdir): return match.groupdict()['branch'] else: raise RepositoryError("Couldn't compute workdir's branch") except IOError: # Try naive way... raise RepositoryError("Couldn't compute workdir's branch") def get_changeset(self): - return self.repository.get_changeset( - self.repository._repo.refs.as_dict().get('HEAD')) + wk_dir_id = self.repository._repo.refs.as_dict().get('HEAD') + return self.repository.get_changeset(wk_dir_id) def checkout_branch(self, branch=None): if branch is None: branch = self.repository.DEFAULT_BRANCH_NAME if branch not in self.repository.branches: raise BranchDoesNotExistError self.repository.run_git_command(['checkout', branch]) diff --git a/vcs/backends/hg/workdir.py b/vcs/backends/hg/workdir.py --- a/vcs/backends/hg/workdir.py +++ b/vcs/backends/hg/workdir.py @@ -5,17 +5,18 @@ from vcs.utils.hgcompat import hg_merge class MercurialWorkdir(BaseWorkdir): def get_branch(self): return self.repository._repo.dirstate.branch() def get_changeset(self): - return self.repository.get_changeset() + wk_dir_id = self.repository._repo[None].parents()[0].hex() + return self.repository.get_changeset(wk_dir_id) def checkout_branch(self, branch=None): if branch is None: branch = self.repository.DEFAULT_BRANCH_NAME if branch not in self.repository.branches: raise BranchDoesNotExistError hg_merge.update(self.repository._repo, branch, False, False, None)
That breaks one test, that i really don't know how to fix...
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
As the docstring say it should return the changeset of checked out workdir but it now returns the last changeset
here's the fix for it:
That breaks one test, that i really don't know how to fix...
The text was updated successfully, but these errors were encountered: