##// END OF EJS Templates
changelog: refuse to add revisions with empty usernames...
Martin Geisler -
r8424:c5b3d3e3 default
parent child Browse files
Show More
@@ -202,6 +202,11 class changelog(revlog.revlog):
202 user=None, date=None, extra={}):
202 user=None, date=None, extra={}):
203
203
204 user = user.strip()
204 user = user.strip()
205 # An empty username or a username with a "\n" will make the
206 # revision text contain two "\n\n" sequences -> corrupt
207 # repository since read cannot unpack the revision.
208 if not user:
209 raise error.RevlogError(_("empty username"))
205 if "\n" in user:
210 if "\n" in user:
206 raise error.RevlogError(_("username %s contains a newline")
211 raise error.RevlogError(_("username %s contains a newline")
207 % repr(user))
212 % repr(user))
@@ -29,3 +29,8 echo "username = " >> .hg/hgrc
29 hg commit -d '1000000 0' -m commit-1
29 hg commit -d '1000000 0' -m commit-1
30 rm .hg/hgrc
30 rm .hg/hgrc
31 hg commit -d '1000000 0' -m commit-1 2>&1 | sed -e "s/'[^']*'/user@host/"
31 hg commit -d '1000000 0' -m commit-1 2>&1 | sed -e "s/'[^']*'/user@host/"
32
33 echo space > asdf
34 hg commit -d '1000000 0' -u ' ' -m commit-1
35
36 true
@@ -24,3 +24,6 summary: commit-1
24
24
25 abort: Please specify a username.
25 abort: Please specify a username.
26 No username found, using user@host instead
26 No username found, using user@host instead
27 transaction abort!
28 rollback completed
29 abort: empty username!
General Comments 0
You need to be logged in to leave comments. Login now