##// END OF EJS Templates
py3: byteify test-lfs.t
Matt Harbison -
r39986:8d41097d default
parent child Browse files
Show More
@@ -549,9 +549,13 b' enabled adds the lfs requirement'
549 549 4 files changed, 2 insertions(+), 0 deletions(-)
550 550 $ hg commit -m binarytest
551 551 $ cat > $TESTTMP/dumpbinary.py << EOF
552 > from mercurial.utils import (
553 > stringutil,
554 > )
552 555 > def reposetup(ui, repo):
553 > for n in 'abcd':
554 > ui.write(('%s: binary=%s\n') % (n, repo['.'][n].isbinary()))
556 > for n in (b'a', b'b', b'c', b'd'):
557 > ui.write((b'%s: binary=%s\n')
558 > % (n, stringutil.pprint(repo[b'.'][n].isbinary())))
555 559 > EOF
556 560 $ hg --config extensions.dumpbinary=$TESTTMP/dumpbinary.py id --trace
557 561 a: binary=True
@@ -679,14 +683,20 b" absence doesn't cause an abort.)"
679 683 > # print raw revision sizes, flags, and hashes for certain files
680 684 > import hashlib
681 685 > from mercurial.node import short
682 > from mercurial import revlog
686 > from mercurial import (
687 > pycompat,
688 > revlog,
689 > )
690 > from mercurial.utils import (
691 > stringutil,
692 > )
683 693 > def hash(rawtext):
684 694 > h = hashlib.sha512()
685 695 > h.update(rawtext)
686 > return h.hexdigest()[:4]
696 > return pycompat.sysbytes(h.hexdigest()[:4])
687 697 > def reposetup(ui, repo):
688 698 > # these 2 files are interesting
689 > for name in ['l', 's']:
699 > for name in [b'l', b's']:
690 700 > fl = repo.file(name)
691 701 > if len(fl) == 0:
692 702 > continue
@@ -694,8 +704,8 b" absence doesn't cause an abort.)"
694 704 > texts = [fl.revision(i, raw=True) for i in fl]
695 705 > flags = [int(fl._revlog.flags(i)) for i in fl]
696 706 > hashes = [hash(t) for t in texts]
697 > print(' %s: rawsizes=%r flags=%r hashes=%r'
698 > % (name, sizes, flags, hashes))
707 > pycompat.stdout.write(b' %s: rawsizes=%r flags=%r hashes=%s\n'
708 > % (name, sizes, flags, stringutil.pprint(hashes)))
699 709 > EOF
700 710
701 711 $ for i in client client2 server repo3 repo4 repo5 repo6 repo7 repo8 repo9 \
General Comments 0
You need to be logged in to leave comments. Login now