diff --git a/hgext/blackbox.py b/hgext/blackbox.py --- a/hgext/blackbox.py +++ b/hgext/blackbox.py @@ -25,7 +25,7 @@ Examples: from mercurial import util, cmdutil from mercurial.i18n import _ -import os, getpass, re +import os, re cmdtable = {} command = cmdutil.command(cmdtable) @@ -55,7 +55,7 @@ def wrapui(ui): if blackbox: date = util.datestr(None, '%Y/%m/%d %H:%M:%S') - user = getpass.getuser() + user = util.getuser() formattedmsg = msg[0] % msg[1:] try: blackbox.write('%s %s> %s' % (date, user, formattedmsg)) diff --git a/tests/test-blackbox.t b/tests/test-blackbox.t --- a/tests/test-blackbox.t +++ b/tests/test-blackbox.t @@ -1,7 +1,6 @@ setup $ cat > mock.py < from mercurial import util - > import getpass > > def makedate(): > return 0, 0 @@ -10,7 +9,7 @@ setup > # mock the date and user apis so the output is always the same > def uisetup(ui): > util.makedate = makedate - > getpass.getuser = getuser + > util.getuser = getuser > EOF $ cat >> $HGRCPATH < [extensions]