##// END OF EJS Templates
blackbox: use util.getuser for portability...
Bryan O'Sullivan -
r18787:f56278a0 default
parent child Browse files
Show More
@@ -25,7 +25,7 b' Examples:'
25 25
26 26 from mercurial import util, cmdutil
27 27 from mercurial.i18n import _
28 import os, getpass, re
28 import os, re
29 29
30 30 cmdtable = {}
31 31 command = cmdutil.command(cmdtable)
@@ -55,7 +55,7 b' def wrapui(ui):'
55 55
56 56 if blackbox:
57 57 date = util.datestr(None, '%Y/%m/%d %H:%M:%S')
58 user = getpass.getuser()
58 user = util.getuser()
59 59 formattedmsg = msg[0] % msg[1:]
60 60 try:
61 61 blackbox.write('%s %s> %s' % (date, user, formattedmsg))
@@ -1,7 +1,6 b''
1 1 setup
2 2 $ cat > mock.py <<EOF
3 3 > from mercurial import util
4 > import getpass
5 4 >
6 5 > def makedate():
7 6 > return 0, 0
@@ -10,7 +9,7 b' setup'
10 9 > # mock the date and user apis so the output is always the same
11 10 > def uisetup(ui):
12 11 > util.makedate = makedate
13 > getpass.getuser = getuser
12 > util.getuser = getuser
14 13 > EOF
15 14 $ cat >> $HGRCPATH <<EOF
16 15 > [extensions]
General Comments 0
You need to be logged in to leave comments. Login now