##// END OF EJS Templates
mq: fix corner cases for handling of patch 0 in qselect...
mq: fix corner cases for handling of patch 0 in qselect Most of the code paths in mq would always pass patch specifications as a string. Patches can be specified by their index, but one code path passed that (through pop) to lookup as an integer - all other code paths used a string. Unfortunately pop and lookup (like many other parts of mq) used the boolean value of the patch specification to see if it was None, and they would thus incorrectly handle patch 0 as None. This patch makes the code comply with the actual internal duck typing of patch specifications: patch indices must be encoded as strings. The (now) unused code for partial and thus incorrect handling of indices as integers is removed.

File last commit:

r15252:6e809bb4 default
r15256:8caf7a75 default
Show More
wirestore.py
29 lines | 914 B | text/x-python | PythonLexer
# Copyright 2010-2011 Fog Creek Software
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
'''largefile store working over Mercurial's wire protocol'''
import lfutil
import remotestore
class wirestore(remotestore.remotestore):
def __init__(self, ui, repo, remote):
cap = remote.capable('largefiles')
if not cap:
raise lfutil.storeprotonotcapable([])
storetypes = cap.split(',')
if not 'serve' in storetypes:
raise lfutil.storeprotonotcapable(storetypes)
self.remote = remote
super(wirestore, self).__init__(ui, repo, remote.url())
def _put(self, hash, fd):
return self.remote.putlfile(hash, fd)
def _get(self, hash):
return self.remote.getlfile(hash)
def _stat(self, hash):
return self.remote.statlfile(hash)