Show More
@@ -15,8 +15,9 b' def get_current_revision(quiet=False):' | |||
|
15 | 15 | repopath = os.path.join(os.path.dirname(__file__), '..', '..') |
|
16 | 16 | scm = get_scm(repopath)[0] |
|
17 | 17 | repo = get_repo(path=repopath, alias=scm) |
|
18 | tip = repo.get_changeset() | |
|
19 | return (tip.revision, tip.short_id) | |
|
18 | wk_dir = repo.workdir | |
|
19 | cur_rev = wk_dir.get_changeset() | |
|
20 | return (cur_rev.revision, cur_rev.short_id) | |
|
20 | 21 | except Exception, err: |
|
21 | 22 | if not quiet: |
|
22 | 23 | print ("WARNING: Cannot retrieve rhodecode's revision. " |
@@ -20,8 +20,8 b' class GitWorkdir(BaseWorkdir):' | |||
|
20 | 20 | raise RepositoryError("Couldn't compute workdir's branch") |
|
21 | 21 | |
|
22 | 22 | def get_changeset(self): |
|
23 | return self.repository.get_changeset( | |
|
24 | self.repository._repo.refs.as_dict().get('HEAD')) | |
|
23 | wk_dir_id = self.repository._repo.refs.as_dict().get('HEAD') | |
|
24 | return self.repository.get_changeset(wk_dir_id) | |
|
25 | 25 | |
|
26 | 26 | def checkout_branch(self, branch=None): |
|
27 | 27 | if branch is None: |
@@ -10,7 +10,8 b' class MercurialWorkdir(BaseWorkdir):' | |||
|
10 | 10 | return self.repository._repo.dirstate.branch() |
|
11 | 11 | |
|
12 | 12 | def get_changeset(self): |
|
13 | return self.repository.get_changeset() | |
|
13 | wk_dir_id = self.repository._repo[None].parents()[0].hex() | |
|
14 | return self.repository.get_changeset(wk_dir_id) | |
|
14 | 15 | |
|
15 | 16 | def checkout_branch(self, branch=None): |
|
16 | 17 | if branch is None: |
General Comments 0
You need to be logged in to leave comments.
Login now