diff --git a/checkout.py b/checkout.py index c6743479d..33c0c31a9 100644 --- a/checkout.py +++ b/checkout.py @@ -143,6 +143,7 @@ class RawCheckout(CheckoutBase): """Ignores svn properties.""" post_processors = post_processors or self.post_processors or [] for p in patches: + logging.debug('Applying %s' % p.filename) try: stdout = '' filename = os.path.join(self.project_path, p.filename) @@ -301,6 +302,7 @@ class SvnCheckout(CheckoutBase, SvnMixIn): def apply_patch(self, patches, post_processors=None): post_processors = post_processors or self.post_processors or [] for p in patches: + logging.debug('Applying %s' % p.filename) try: # It is important to use credentials=False otherwise credentials could # leak in the error message. Credentials are not necessary here for the @@ -507,6 +509,7 @@ class GitCheckoutBase(CheckoutBase): ['checkout', '-b', self.working_branch, '%s/%s' % (self.remote, self.remote_branch), '--quiet']) for index, p in enumerate(patches): + logging.debug('Applying %s' % p.filename) try: stdout = '' if p.is_delete: diff --git a/patch.py b/patch.py index e7bf56648..44282ddaf 100644 --- a/patch.py +++ b/patch.py @@ -503,11 +503,13 @@ class PatchSet(object): File move are first. Deletes are last. """ - if p.source_filename: - return (p.is_delete, p.source_filename_utf8, p.filename_utf8) - else: - # tuple are always greater than string, abuse that fact. - return (p.is_delete, (p.filename_utf8,), p.filename_utf8) + # The bool is necessary because None < 'string' but the reverse is needed. + return ( + p.is_delete, + # False is before True, so files *with* a source file will be first. + not bool(p.source_filename), + p.source_filename_utf8, + p.filename_utf8) self.patches = sorted(patches, key=key)