implement mercurial getChangeset

This commit is contained in:
Sebastian Sdorra
2012-01-19 15:56:53 +01:00
parent 06883d5f14
commit e183ada66f
4 changed files with 67 additions and 9 deletions

View File

@@ -131,8 +131,7 @@ def printFooter():
print ' </changesets>'
print '</changeset-paging>'
def printChangesetsForPath(repo, path):
rev = os.environ['SCM_REVISION']
def printChangesetsForPath(repo, rev, path):
if len(rev) <= 0:
rev = "tip"
@@ -178,9 +177,14 @@ repo = hg.repository(ui.ui(), path = repositoryPath)
path = os.environ['SCM_PATH']
startNode = os.environ['SCM_REVISION_START']
endNode = os.environ['SCM_REVISION_END']
rev = os.environ['SCM_REVISION']
if len(path) > 0:
printChangesetsForPath(repo, path)
printChangesetsForPath(repo, rev, path)
elif len(rev) > 0:
ctx = repo[rev]
print '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'
printChangeset(repo, ctx)
else:
if len(startNode) > 0 and len(endNode) > 0:
# start and end revision