mercurial/changelog.py
changeset 39793 b63dee7bd0d9
parent 39328 5763216ba311
child 39892 a3095bc47217
equal deleted inserted replaced
39792:cb65d4b7e429 39793:b63dee7bd0d9
   511         user = user.strip()
   511         user = user.strip()
   512         # An empty username or a username with a "\n" will make the
   512         # An empty username or a username with a "\n" will make the
   513         # revision text contain two "\n\n" sequences -> corrupt
   513         # revision text contain two "\n\n" sequences -> corrupt
   514         # repository since read cannot unpack the revision.
   514         # repository since read cannot unpack the revision.
   515         if not user:
   515         if not user:
   516             raise error.RevlogError(_("empty username"))
   516             raise error.StorageError(_("empty username"))
   517         if "\n" in user:
   517         if "\n" in user:
   518             raise error.RevlogError(_("username %r contains a newline")
   518             raise error.StorageError(_("username %r contains a newline")
   519                                     % pycompat.bytestr(user))
   519                                      % pycompat.bytestr(user))
   520 
   520 
   521         desc = stripdesc(desc)
   521         desc = stripdesc(desc)
   522 
   522 
   523         if date:
   523         if date:
   524             parseddate = "%d %d" % dateutil.parsedate(date)
   524             parseddate = "%d %d" % dateutil.parsedate(date)
   527         if extra:
   527         if extra:
   528             branch = extra.get("branch")
   528             branch = extra.get("branch")
   529             if branch in ("default", ""):
   529             if branch in ("default", ""):
   530                 del extra["branch"]
   530                 del extra["branch"]
   531             elif branch in (".", "null", "tip"):
   531             elif branch in (".", "null", "tip"):
   532                 raise error.RevlogError(_('the name \'%s\' is reserved')
   532                 raise error.StorageError(_('the name \'%s\' is reserved')
   533                                         % branch)
   533                                          % branch)
   534         if extra:
   534         if extra:
   535             extra = encodeextra(extra)
   535             extra = encodeextra(extra)
   536             parseddate = "%s %s" % (parseddate, extra)
   536             parseddate = "%s %s" % (parseddate, extra)
   537         l = [hex(manifest), user, parseddate] + sorted(files) + ["", desc]
   537         l = [hex(manifest), user, parseddate] + sorted(files) + ["", desc]
   538         text = "\n".join(l)
   538         text = "\n".join(l)