Changeset - 2b5f94fc3b7a
[Not reviewed]
beta
0 3 0
Marcin Kuzminski - 13 years ago 2013-04-27 11:45:27
marcin@python-works.com
current revision will show workdir state, not the latest revision
3 files changed with 7 insertions and 5 deletions:
0 comments (0 inline, 0 general)
rhodecode/lib/__init__.py
Show inline comments
 
@@ -15,8 +15,9 @@ def get_current_revision(quiet=False):
 
        repopath = os.path.join(os.path.dirname(__file__), '..', '..')
 
        scm = get_scm(repopath)[0]
 
        repo = get_repo(path=repopath, alias=scm)
 
        tip = repo.get_changeset()
 
        return (tip.revision, tip.short_id)
 
        wk_dir = repo.workdir
 
        cur_rev = wk_dir.get_changeset()
 
        return (cur_rev.revision, cur_rev.short_id)
 
    except Exception, err:
 
        if not quiet:
 
            print ("WARNING: Cannot retrieve rhodecode's revision. "
rhodecode/lib/vcs/backends/git/workdir.py
Show inline comments
 
@@ -20,8 +20,8 @@ class GitWorkdir(BaseWorkdir):
 
            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:
rhodecode/lib/vcs/backends/hg/workdir.py
Show inline comments
 
@@ -10,7 +10,8 @@ class MercurialWorkdir(BaseWorkdir):
 
        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:
0 comments (0 inline, 0 general)