def __call__(self, *args, **kwargs): if args: if args[0] == 'push': with abdt_logging.remote_io_write_event_context( 'git-push', '{}: {} {}'.format( self._description, ' '.join(args), kwargs)): return self._repo(*args, **kwargs) elif args[0] in ('fetch', 'pull', 'ls-remote'): # N.B. git-archive may also read but we're not using it return self._log_read_call(args, kwargs) elif len(args) >= 2 and args[:2] == ('remote', 'prune'): return self._log_read_call(args, kwargs) return self._repo(*args, **kwargs)
def __call__(self, *args, **kwargs): if args: if args[0] == 'push': with abdt_logging.remote_io_write_event_context( 'git-push', '{}: {} {}'.format(self._description, ' '.join(args), kwargs)): return self._repo(*args, **kwargs) elif args[0] in ('fetch', 'pull', 'ls-remote'): # N.B. git-archive may also read but we're not using it return self._log_read_call(args, kwargs) elif len(args) >= 2 and args[:2] == ('remote', 'prune'): return self._log_read_call(args, kwargs) return self._repo(*args, **kwargs)
def _log_context(self, identifier, description): return abdt_logging.remote_io_write_event_context( identifier, '{}:{}'.format(self.describe(), description))
def _log_context(self, identifier, description): return abdt_logging.remote_io_write_event_context( identifier, '{}:{}'.format(self.describe(), description))