mercurial/localrepo.py
changeset 6254 3667b6e4bbd0
parent 6243 437eef39458d
child 6312 08800489257e
equal deleted inserted replaced
6253:a7e3d0456d92 6254:3667b6e4bbd0
   881                 os.chdir(olddir)
   881                 os.chdir(olddir)
   882 
   882 
   883             if branchname:
   883             if branchname:
   884                 extra["branch"] = branchname
   884                 extra["branch"] = branchname
   885 
   885 
   886             if use_dirstate:
   886             lines = [line.rstrip() for line in text.rstrip().splitlines()]
   887                 lines = [line.rstrip() for line in text.rstrip().splitlines()]
   887             while lines and not lines[0]:
   888                 while lines and not lines[0]:
   888                 del lines[0]
   889                     del lines[0]
   889             if not lines and use_dirstate:
   890                 if not lines:
   890                 raise util.Abort(_("empty commit message"))
   891                     raise util.Abort(_("empty commit message"))
   891             text = '\n'.join(lines)
   892                 text = '\n'.join(lines)
       
   893 
   892 
   894             n = self.changelog.add(mn, changed + removed, text, trp, p1, p2,
   893             n = self.changelog.add(mn, changed + removed, text, trp, p1, p2,
   895                                    user, date, extra)
   894                                    user, date, extra)
   896             self.hook('pretxncommit', throw=True, node=hex(n), parent1=xp1,
   895             self.hook('pretxncommit', throw=True, node=hex(n), parent1=xp1,
   897                       parent2=xp2)
   896                       parent2=xp2)