mercurial/changelog.py
changeset 33979 3939b30d0cb7
parent 32315 67026d65a4fc
child 34028 bfb38c5cebf4
equal deleted inserted replaced
33978:088598153aa2 33979:3939b30d0cb7
    12 from .i18n import _
    12 from .i18n import _
    13 from .node import (
    13 from .node import (
    14     bin,
    14     bin,
    15     hex,
    15     hex,
    16     nullid,
    16     nullid,
       
    17     wdirid,
    17 )
    18 )
    18 
    19 
    19 from . import (
    20 from . import (
    20     encoding,
    21     encoding,
    21     error,
    22     error,
   533 
   534 
   534     def _addrevision(self, node, rawtext, transaction, *args, **kwargs):
   535     def _addrevision(self, node, rawtext, transaction, *args, **kwargs):
   535         # overlay over the standard revlog._addrevision to track the new
   536         # overlay over the standard revlog._addrevision to track the new
   536         # revision on the transaction.
   537         # revision on the transaction.
   537         rev = len(self)
   538         rev = len(self)
       
   539         if node == wdirid: # nullid is checked in super method
       
   540             raise error.RevlogError(_("%s: attempt to add wdir revision") %
       
   541                                     (self.indexfile))
   538         node = super(changelog, self)._addrevision(node, rawtext, transaction,
   542         node = super(changelog, self)._addrevision(node, rawtext, transaction,
   539                                                    *args, **kwargs)
   543                                                    *args, **kwargs)
   540         revs = transaction.changes.get('revs')
   544         revs = transaction.changes.get('revs')
   541         if revs is not None:
   545         if revs is not None:
   542             revs.add(rev)
   546             revs.add(rev)