Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/ui.py @ 1903:e4abeafd6eb1
move shortuser into util module.
author | Vadim Gelfer <vadim.gelfer@gmail.com> |
---|---|
date | Mon, 27 Feb 2006 11:32:10 -0800 |
parents | 3b1b44b917f4 |
children | b7cc0f323a4c |
comparison
equal
deleted
inserted
replaced
1902:1cc5f25653a3 | 1903:e4abeafd6eb1 |
---|---|
102 os.environ.get("USERNAME", "unknown")) | 102 os.environ.get("USERNAME", "unknown")) |
103 + '@' + socket.getfqdn())) | 103 + '@' + socket.getfqdn())) |
104 | 104 |
105 def shortuser(self, user): | 105 def shortuser(self, user): |
106 """Return a short representation of a user name or email address.""" | 106 """Return a short representation of a user name or email address.""" |
107 if not self.verbose: | 107 if not self.verbose: user = util.shortuser(user) |
108 f = user.find('@') | |
109 if f >= 0: | |
110 user = user[:f] | |
111 f = user.find('<') | |
112 if f >= 0: | |
113 user = user[f+1:] | |
114 return user | 108 return user |
115 | 109 |
116 def expandpath(self, loc, root=""): | 110 def expandpath(self, loc, root=""): |
117 paths = {} | 111 paths = {} |
118 for name, path in self.configitems("paths"): | 112 for name, path in self.configitems("paths"): |