mercurial/verify.py
changeset 47012 d55b71393907
parent 46895 6085b7f1536d
child 47138 bc138f2a2e47
equal deleted inserted replaced
46992:5fa019ceb499 47012:d55b71393907
     8 from __future__ import absolute_import
     8 from __future__ import absolute_import
     9 
     9 
    10 import os
    10 import os
    11 
    11 
    12 from .i18n import _
    12 from .i18n import _
    13 from .node import (
    13 from .node import short
    14     nullid,
    14 from .utils import stringutil
    15     short,
       
    16 )
       
    17 from .utils import (
       
    18     stringutil,
       
    19 )
       
    20 
    15 
    21 from . import (
    16 from . import (
    22     error,
    17     error,
    23     pycompat,
    18     pycompat,
    24     revlog,
    19     revlog,
   157                 )
   152                 )
   158             lr = None  # can't be trusted
   153             lr = None  # can't be trusted
   159 
   154 
   160         try:
   155         try:
   161             p1, p2 = obj.parents(node)
   156             p1, p2 = obj.parents(node)
   162             if p1 not in seen and p1 != nullid:
   157             if p1 not in seen and p1 != self.repo.nullid:
   163                 self._err(
   158                 self._err(
   164                     lr,
   159                     lr,
   165                     _(b"unknown parent 1 %s of %s") % (short(p1), short(node)),
   160                     _(b"unknown parent 1 %s of %s") % (short(p1), short(node)),
   166                     f,
   161                     f,
   167                 )
   162                 )
   168             if p2 not in seen and p2 != nullid:
   163             if p2 not in seen and p2 != self.repo.nullid:
   169                 self._err(
   164                 self._err(
   170                     lr,
   165                     lr,
   171                     _(b"unknown parent 2 %s of %s") % (short(p2), short(node)),
   166                     _(b"unknown parent 2 %s of %s") % (short(p2), short(node)),
   172                     f,
   167                     f,
   173                 )
   168                 )
   265             n = cl.node(i)
   260             n = cl.node(i)
   266             self._checkentry(cl, i, n, seen, [i], b"changelog")
   261             self._checkentry(cl, i, n, seen, [i], b"changelog")
   267 
   262 
   268             try:
   263             try:
   269                 changes = cl.read(n)
   264                 changes = cl.read(n)
   270                 if changes[0] != nullid:
   265                 if changes[0] != self.repo.nullid:
   271                     mflinkrevs.setdefault(changes[0], []).append(i)
   266                     mflinkrevs.setdefault(changes[0], []).append(i)
   272                     self.refersmf = True
   267                     self.refersmf = True
   273                 for f in changes[3]:
   268                 for f in changes[3]:
   274                     if match(f):
   269                     if match(f):
   275                         filelinkrevs.setdefault(_normpath(f), []).append(i)
   270                         filelinkrevs.setdefault(_normpath(f), []).append(i)
   596                                     b"%s:%s"
   591                                     b"%s:%s"
   597                                 )
   592                                 )
   598                                 % (rp[0], short(rp[1])),
   593                                 % (rp[0], short(rp[1])),
   599                                 f,
   594                                 f,
   600                             )
   595                             )
   601                         elif rp[1] == nullid:
   596                         elif rp[1] == self.repo.nullid:
   602                             ui.note(
   597                             ui.note(
   603                                 _(
   598                                 _(
   604                                     b"warning: %s@%s: copy source"
   599                                     b"warning: %s@%s: copy source"
   605                                     b" revision is nullid %s:%s\n"
   600                                     b" revision is nullid %s:%s\n"
   606                                 )
   601                                 )