def wrappedwireprotoheads(orig, repo, proto, *args, **kwargs): """Wraps "heads" wire protocol command. This will short circuit pushes and pulls on discovery repos. If we don't do this, clients will waste time uploading a bundle only to find out that the server doesn't support pushing! Ideally, we'd short circuit "unbundle." However, there are the following issues: 1) A client will create a bundle before sending it to the server. This will take minutes on mozilla-central. 2) Bundle2 aware HTTP clients don't like receiving a "pusherr" response from unbundle - they insist on receiving a bundle2 payload. However, the server doesn't know if the client supports bundle2 until it reads the header from the bundle submission! """ if not repo.ui.configbool('reviewboard', 'isdiscoveryrepo'): return orig(repo, proto, *args, **kwargs) return wireproto.ooberror(nopushdiscoveryrepos)
def heads(repo, proto): if lfutil.islfilesrepo(repo): return wireproto.ooberror(LARGEFILES_REQUIRED_MSG) return wireproto.heads(repo, proto)
def heads(repo, proto): '''Wrap server command - largefile capable clients will know to call lheads instead''' if lfutil.islfilesrepo(repo): return wireproto.ooberror(LARGEFILES_REQUIRED_MSG) return wireproto.heads(repo, proto)