Skip to content

Commit

Permalink
Fix 500 error when attempting to update installed repository.
Browse files Browse the repository at this point in the history
  • Loading branch information
davebx authored and martenson committed Nov 14, 2015
1 parent 64b0840 commit 75e7e4c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/galaxy/webapps/tool_shed/framework/middleware/hg.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import sqlalchemy
import sys
import tempfile
import urlparse
from paste.auth.basic import AuthBasicAuthenticator
from paste.httpheaders import AUTH_TYPE
from paste.httpheaders import REMOTE_USER
Expand Down Expand Up @@ -51,11 +52,11 @@ def __call__( self, environ, start_response ):
# a clone or a pull. However, we do not want to increment the times_downloaded count if we're only setting repository
# metadata.
if cmd == 'getbundle' and not self.setting_repository_metadata:
common, _ = environ[ 'HTTP_X_HGARG_1' ].split( '&' )
hg_args = urlparse.parse_qs( environ[ 'HTTP_X_HGARG_1' ] )
# The 'common' parameter indicates the full sha-1 hash of the changeset the client currently has checked out. If
# this is 0000000000000000000000000000000000000000, then the client is performing a fresh checkout. If it has any
# other value, the client is getting updates to an existing checkout.
if common == 'common=0000000000000000000000000000000000000000':
if 'common' in hg_args and hg_args[ 'common' ][-1] == '0000000000000000000000000000000000000000':
# Increment the value of the times_downloaded column in the repository table for the cloned repository.
if 'PATH_INFO' in environ:
# Instantiate a database connection
Expand Down

0 comments on commit 75e7e4c

Please sign in to comment.