Skip to content

Commit

Permalink
vr.common 5.4.1 adds support for accepting None as default for rev pa…
Browse files Browse the repository at this point in the history
…rameter to Repo.update
  • Loading branch information
Jason R. Coombs committed Jul 3, 2018
1 parent b72b613 commit 42bc401
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 25 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
'path.py>=7.1',
'yg.lockfile',
'jaraco.itertools',
'vr.common>=4.3.0',
'vr.common>=5.4.1',
],
extras_require={
'testing': [
Expand Down
25 changes: 1 addition & 24 deletions vr/builder/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import yg.lockfile

from vr.common import repo
from vr.common.utils import run, mkdir, chdir
from vr.common.utils import run, mkdir
from vr.common.paths import VR_ROOT

from vr.builder.slugignore import clean_slug_dir
Expand Down Expand Up @@ -75,29 +75,6 @@ def release(self, app):
"buildpack" % (app, self.basename))
return yaml.safe_load(result.output)

def update(self, rev=None):
"""
Override Repo.update to provide default rev when none is provided.
"""
if not os.path.exists(self.folder):
self.clone()

# account for self.fragment=='' case
rev = rev or self.fragment or None

if self.vcs_type == 'git':
if rev is None:
# Git needs special handling if no rev is passed.
# Don't ask for a revision, just do a pull.
with chdir(self.folder):
self.run('git fetch --tags')
self.run('git pull origin master')
else:
return super(BuildPack, self).update(rev)
elif self.vcs_type == 'hg':
# Are there actually any mercurial buildpacks?
return super(BuildPack, self).update(rev or 'tip')


class App(repo.Repo):
"""
Expand Down

0 comments on commit 42bc401

Please sign in to comment.