Mercurial > public > mercurial-scm > hg
comparison mercurial/ui.py @ 6351:eed0a6a05096
ui: disallow newlines in usernames (issue1034)
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Sat, 22 Mar 2008 13:50:59 -0500 |
parents | f477afeb3a0f |
children | f67d1468ac50 |
comparison
equal
deleted
inserted
replaced
6350:6aa4a3fa4e60 | 6351:eed0a6a05096 |
---|---|
349 self.warn(_("No username found, using '%s' instead\n") % user) | 349 self.warn(_("No username found, using '%s' instead\n") % user) |
350 except KeyError: | 350 except KeyError: |
351 pass | 351 pass |
352 if not user: | 352 if not user: |
353 raise util.Abort(_("Please specify a username.")) | 353 raise util.Abort(_("Please specify a username.")) |
354 if "\n" in user: | |
355 raise util.Abort(_("username %s contains a newline\n") % `user`) | |
354 return user | 356 return user |
355 | 357 |
356 def shortuser(self, user): | 358 def shortuser(self, user): |
357 """Return a short representation of a user name or email address.""" | 359 """Return a short representation of a user name or email address.""" |
358 if not self.verbose: user = util.shortuser(user) | 360 if not self.verbose: user = util.shortuser(user) |