Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
mercurial-devel
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mercurial
mercurial-devel
Commits
e6a41cba
Commit
e6a41cba
authored
18 years ago
by
Vadim Gelfer
Browse files
Options
Downloads
Patches
Plain Diff
fix windows username problem.
parent
02b6fa7b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
mercurial/ui.py
+1
-1
1 addition, 1 deletion
mercurial/ui.py
mercurial/util.py
+12
-1
12 additions, 1 deletion
mercurial/util.py
mercurial/util_win32.py
+2
-0
2 additions, 0 deletions
mercurial/util_win32.py
with
15 additions
and
2 deletions
mercurial/ui.py
+
1
−
1
View file @
e6a41cba
...
...
@@ -197,7 +197,7 @@
user
=
os
.
environ
.
get
(
"
EMAIL
"
)
if
user
is
None
:
try
:
user
=
'
%s@%s
'
%
(
getpass
.
getuser
(),
socket
.
getfqdn
())
user
=
'
%s@%s
'
%
(
util
.
getuser
(),
socket
.
getfqdn
())
except
KeyError
:
raise
util
.
Abort
(
_
(
"
Please specify a username.
"
))
return
user
...
...
This diff is collapsed.
Click to expand it.
mercurial/util.py
+
12
−
1
View file @
e6a41cba
...
...
@@ -12,7 +12,7 @@
from
i18n
import
gettext
as
_
from
demandload
import
*
demandload
(
globals
(),
"
cStringIO errno popen2 re shutil sys tempfile
"
)
demandload
(
globals
(),
"
cStringIO errno
getpass
popen2 re shutil sys tempfile
"
)
demandload
(
globals
(),
"
os threading time
"
)
# used by parsedate
...
...
@@ -510,6 +510,17 @@
except
AttributeError
:
return
os
.
name
==
'
nt
'
and
'
command
'
in
os
.
environ
.
get
(
'
comspec
'
,
''
)
getuser_fallback
=
None
def
getuser
():
'''
return name of current user
'''
try
:
return
getpass
.
getuser
()
except
ImportError
:
return
getuser_fallback
and
getuser_fallback
()
raise
util
.
Abort
(
_
(
'
user name not available - set USERNAME
'
'
environment variable
'
))
# Platform specific variants
if
os
.
name
==
'
nt
'
:
demandload
(
globals
(),
"
msvcrt
"
)
...
...
This diff is collapsed.
Click to expand it.
mercurial/util_win32.py
+
2
−
0
View file @
e6a41cba
...
...
@@ -297,3 +297,5 @@
win32file
.
SetEndOfFile
(
self
.
handle
)
except
pywintypes
.
error
,
err
:
raise
WinIOError
(
err
)
getuser_fallback
=
win32api
.
GetUserName
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment