425 # Checks needed to be done: |
425 # Checks needed to be done: |
426 # 1. length check: L1 == L2, in all cases. |
426 # 1. length check: L1 == L2, in all cases. |
427 # 2. hash check: depending on flag processor, we may need to |
427 # 2. hash check: depending on flag processor, we may need to |
428 # use either "text" (external), or "rawtext" (in revlog). |
428 # use either "text" (external), or "rawtext" (in revlog). |
429 try: |
429 try: |
430 l = len(fl.read(n)) |
430 fl.read(n) # side effect: read content and do checkhash |
431 rp = fl.renamed(n) |
431 rp = fl.renamed(n) |
432 if l != fl.size(i): |
432 # the "L1 == L2" check |
433 # the "L1 == L2" check |
433 l1 = fl.rawsize(i) |
434 if len(fl.revision(n, raw=True)) != fl.rawsize(i): |
434 l2 = len(fl.revision(n, raw=True)) |
435 self.err(lr, _("unpacked size is %s, %s expected") % |
435 if l1 != l2: |
436 (l, fl.size(i)), f) |
436 self.err(lr, _("unpacked size is %s, %s expected") % |
|
437 (l2, l1), f) |
437 except error.CensoredNodeError: |
438 except error.CensoredNodeError: |
438 # experimental config: censor.policy |
439 # experimental config: censor.policy |
439 if ui.config("censor", "policy", "abort") == "abort": |
440 if ui.config("censor", "policy", "abort") == "abort": |
440 self.err(lr, _("censored file data"), f) |
441 self.err(lr, _("censored file data"), f) |
441 except Exception as inst: |
442 except Exception as inst: |