diff --git a/remotefilelog/remotefilectx.py b/remotefilelog/remotefilectx.py --- a/remotefilelog/remotefilectx.py +++ b/remotefilelog/remotefilectx.py @@ -9,6 +9,7 @@ from mercurial.i18n import _ from mercurial.node import bin, hex, nullid, nullrev from mercurial import context, util, error, ancestor, phases, extensions +from . import shallowutil propertycache = util.propertycache conduit = None @@ -240,6 +241,16 @@ if self._verifylinknode(revs, linknode): return linknode + commonlogkwargs = { + 'revs': ' '.join([hex(cl.node(rev)) for rev in revs]), + 'fnode': hex(fnode), + 'filepath': path, + 'user': shallowutil.getusername(repo.ui), + 'reponame': shallowutil.getreponame(repo.ui), + } + + repo.ui.log('linkrevfixup', 'adjusting linknode', **commonlogkwargs) + pc = repo._phasecache seenpublic = False iteranc = cl.ancestors(revs, inclusive=inclusive) @@ -296,7 +307,7 @@ # commits if repo.ui.configbool('fastlog', 'enabled'): lnode = self._linknodeviafastlog(repo, path, ancrev, fnode, - cl, mfl) + cl, mfl, commonlogkwargs) if lnode: return lnode seenpublic = True @@ -320,7 +331,8 @@ return linknode - def _linknodeviafastlog(self, repo, path, srcrev, fnode, cl, mfl): + def _linknodeviafastlog(self, repo, path, srcrev, fnode, cl, mfl, + commonlogkwargs): reponame = repo.ui.config('fbconduit', 'reponame') logmsg = '' if self._conduit is None: @@ -351,7 +363,7 @@ logmsg = 'fastlog failed (%s)' % e return None finally: - repo.ui.log('linkrevfixup', logmsg) + repo.ui.log('linkrevfixup', logmsg, **commonlogkwargs) def _verifylinknode(self, revs, linknode): diff --git a/remotefilelog/shallowutil.py b/remotefilelog/shallowutil.py --- a/remotefilelog/shallowutil.py +++ b/remotefilelog/shallowutil.py @@ -477,3 +477,15 @@ def peercapabilities(peer): """return capabilities of a peer""" return trygetattr(peer, ('_capabilities', 'capabilities'))() + +def getusername(ui): + try: + return util.shortuser(ui.username()) + except Exception: + return 'unknown' + +def getreponame(ui): + reponame = ui.config('paths', 'default') + if reponame: + return os.path.basename(reponame) + return "unknown"