mirror of
https://github.com/facebook/sapling.git
synced 2024-10-11 09:17:30 +03:00
d203784d68
Summary: As the title. Test Plan: `arc unit` Reviewers: #sourcecontrol, stash, rmcelroy Reviewed By: stash, rmcelroy Subscribers: rmcelroy, stash, mjpieters Differential Revision: https://phabricator.intern.facebook.com/D4232321 Signature: t1:4232321:1480067588:54e91ece8fa6b5ff13b3ebc9279217c76bf96a24
31 lines
888 B
Python
31 lines
888 B
Python
# reporootlog.py - log the repo root
|
|
#
|
|
# Copyright 2016 Facebook, Inc.
|
|
#
|
|
# This software may be used and distributed according to the terms of the
|
|
# GNU General Public License version 2 or any later version.
|
|
|
|
"""This extension logs different pieces of information that will be used
|
|
by SCM wrappers
|
|
"""
|
|
|
|
import os
|
|
from mercurial import (
|
|
extensions,
|
|
localrepo,
|
|
)
|
|
|
|
def _localrepoinit(orig, self, baseui, path=None, create=False):
|
|
orig(self, baseui, path, create)
|
|
reponame = self.ui.config('paths', 'default', path)
|
|
if reponame:
|
|
reponame = os.path.basename(reponame)
|
|
kwargs = {'repo': reponame}
|
|
self.ui.log("logginghelper",
|
|
"", # ui.log requires a format string as args[0].
|
|
**kwargs)
|
|
|
|
def uisetup(ui):
|
|
extensions.wrapfunction(localrepo.localrepository,
|
|
'__init__', _localrepoinit)
|