1
1
Fork 0
mirror of https://github.com/pypa/pip synced 2023-12-13 21:30:23 +01:00

Another tweak to fix #32, #150 and #161. Thanks Hugo for reminding me about #150.

This commit is contained in:
Jannis Leidel 2010-11-21 17:43:26 +01:00
parent ced226c246
commit b2ebc60cd9

View file

@ -100,9 +100,10 @@ class Git(VersionControl):
[self.cmd, 'checkout', '-q'] + rev_options, cwd=dest) [self.cmd, 'checkout', '-q'] + rev_options, cwd=dest)
def update(self, dest, rev_options): def update(self, dest, rev_options):
# First fetch changes from the default remote
call_subprocess([self.cmd, 'fetch', '-q'], cwd=dest) call_subprocess([self.cmd, 'fetch', '-q'], cwd=dest)
call_subprocess( # Then reset to wanted revision (maby even origin/master)
[self.cmd, 'checkout', '-q', '-f'] + rev_options, cwd=dest) call_subprocess([self.cmd, 'reset', '--hard', '-q'] + rev_options, cwd=dest)
def obtain(self, dest): def obtain(self, dest):
url, rev = self.get_url_rev() url, rev = self.get_url_rev()
@ -110,7 +111,7 @@ class Git(VersionControl):
rev_options = [rev] rev_options = [rev]
rev_display = ' (to %s)' % rev rev_display = ' (to %s)' % rev
else: else:
rev_options = ['master'] rev_options = ['origin/master']
rev_display = '' rev_display = ''
if self.check_destination(dest, url, rev_options, rev_display): if self.check_destination(dest, url, rev_options, rev_display):
logger.notify('Cloning %s%s to %s' % (url, rev_display, display_path(dest))) logger.notify('Cloning %s%s to %s' % (url, rev_display, display_path(dest)))