Merge pull request #10756 from Vye/add_explicit_git_revision_winrepo

added explicit git revision support to winrepo
This commit is contained in:
Thomas S Hatch 2014-02-26 11:32:48 -07:00
commit b08d5916e3
3 changed files with 11 additions and 1 deletions

View File

@ -105,9 +105,14 @@ def update_git_repos():
#else:
#targetname = gitrepo
targetname = gitrepo
rev = None
# If a revision is specified, use it.
if len(gitrepo.strip().split(' ')) > 1:
rev, gitrepo = gitrepo.strip().split(' ')
gittarget = os.path.join(repo, targetname)
#result = mminion.states['git.latest'](gitrepo,
result = __salt__['git.latest'](gitrepo,
rev=rev,
target=gittarget,
force=True)
ret[result['name']] = result['result']

View File

@ -91,8 +91,13 @@ def update_git_repos():
targetname = gitrepo.split('/')[-1]
else:
targetname = gitrepo
rev = None
# If a revision is specified, use it.
if len(gitrepo.strip().split(' ')) > 1:
rev, gitrepo = gitrepo.strip().split(' ')
gittarget = os.path.join(repo, targetname)
result = mminion.states['git.latest'](gitrepo,
rev=rev,
target=gittarget,
force=True)
ret[result['name']] = result['result']

View File

@ -213,7 +213,7 @@ def latest(name,
identity=identity)
elif rev:
cmd = 'git rev-parse {0} ^{{commit}}'.format(rev)
cmd = 'git rev-parse {0}'.format(rev)
retcode = __salt__['cmd.retcode'](cmd,
cwd=target,
runas=user)