commit/galaxy-central: 2 new changesets
2 new commits in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/9860d1c6998d/ Changeset: 9860d1c6998d Branch: next-stable User: greg Date: 2014-07-30 16:41:52 Summary: Do not increment a repository's times_downloaded counter when setting metadata on it. Affected #: 1 file diff -r 6b44b99b79b8c4383e8475e409c53f9deae7f7ff -r 9860d1c6998d38f633a11aae45bd3f667e236cc0 lib/galaxy/webapps/tool_shed/framework/middleware/hg.py --- a/lib/galaxy/webapps/tool_shed/framework/middleware/hg.py +++ b/lib/galaxy/webapps/tool_shed/framework/middleware/hg.py @@ -22,6 +22,7 @@ CHUNK_SIZE = 65536 + class Hg( object ): def __init__( self, app, config ): @@ -35,12 +36,20 @@ self.db_url = self.config[ 'database_connection' ] else: self.db_url = "sqlite:///%s?isolation_level=IMMEDIATE" % self.config[ 'database_file' ] + # Keep track of whether we're setting repository metadata so that we do not increment the times_downloaded + # count for the repository. + self.setting_repository_metadata = False def __call__( self, environ, start_response ): + if 'PATH_INFO' in environ: + path_info = environ[ 'PATH_INFO' ].lstrip( '/' ) + if path_info == 'repository/reset_all_metadata': + self.setting_repository_metadata = True cmd = self.__get_hg_command( **environ ) # The 'getbundle' command indicates that a mercurial client is getting a bundle of one or more changesets, indicating - # a clone or a pull. - if cmd == 'getbundle': + # 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( '&' ) # 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 https://bitbucket.org/galaxy/galaxy-central/commits/157adaf92f9c/ Changeset: 157adaf92f9c User: greg Date: 2014-07-30 16:42:28 Summary: Merged next-stable Affected #: 1 file diff -r 38ba45d6ba5be65b3b743fc08739e16cd6e0ac8f -r 157adaf92f9c5f06a2ae50a1e7103d0b29543a07 lib/galaxy/webapps/tool_shed/framework/middleware/hg.py --- a/lib/galaxy/webapps/tool_shed/framework/middleware/hg.py +++ b/lib/galaxy/webapps/tool_shed/framework/middleware/hg.py @@ -22,6 +22,7 @@ CHUNK_SIZE = 65536 + class Hg( object ): def __init__( self, app, config ): @@ -35,12 +36,20 @@ self.db_url = self.config[ 'database_connection' ] else: self.db_url = "sqlite:///%s?isolation_level=IMMEDIATE" % self.config[ 'database_file' ] + # Keep track of whether we're setting repository metadata so that we do not increment the times_downloaded + # count for the repository. + self.setting_repository_metadata = False def __call__( self, environ, start_response ): + if 'PATH_INFO' in environ: + path_info = environ[ 'PATH_INFO' ].lstrip( '/' ) + if path_info == 'repository/reset_all_metadata': + self.setting_repository_metadata = True cmd = self.__get_hg_command( **environ ) # The 'getbundle' command indicates that a mercurial client is getting a bundle of one or more changesets, indicating - # a clone or a pull. - if cmd == 'getbundle': + # 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( '&' ) # 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 Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
commits-noreply@bitbucket.org