comparison mercurial/debugcommands.py @ 32315:67026d65a4fc

revlog: rename constants (API) Feature flag constants don't need "NG" in the name because they will presumably apply to non-"NG" version revlogs. All feature flag constants should also share a similar naming convention to identify them as such. And, "RevlogNG" isn't a great internal name since it isn't obvious it maps to version 1 revlogs. Plus, "NG" (next generation) is only a good name as long as it is the latest version. Since we're talking about version 2, now is as good a time as any to move on from that naming.
author Gregory Szorc <gregory.szorc@gmail.com>
date Wed, 17 May 2017 19:52:18 -0700
parents ccef71de7d41
children 46ba2cdda476
comparison
equal deleted inserted replaced
32314:9f35c7836f60 32315:67026d65a4fc
559 :``extraratio``: extradist divided by chainsize; another representation of 559 :``extraratio``: extradist divided by chainsize; another representation of
560 how much unrelated data is needed to load this delta chain 560 how much unrelated data is needed to load this delta chain
561 """ 561 """
562 r = cmdutil.openrevlog(repo, 'debugdeltachain', file_, opts) 562 r = cmdutil.openrevlog(repo, 'debugdeltachain', file_, opts)
563 index = r.index 563 index = r.index
564 generaldelta = r.version & revlog.REVLOGGENERALDELTA 564 generaldelta = r.version & revlog.FLAG_GENERALDELTA
565 565
566 def revinfo(rev): 566 def revinfo(rev):
567 e = index[rev] 567 e = index[rev]
568 compsize = e[1] 568 compsize = e[1]
569 uncompsize = e[2] 569 uncompsize = e[2]
890 r = cmdutil.openrevlog(repo, 'debugindex', file_, opts) 890 r = cmdutil.openrevlog(repo, 'debugindex', file_, opts)
891 format = opts.get('format', 0) 891 format = opts.get('format', 0)
892 if format not in (0, 1): 892 if format not in (0, 1):
893 raise error.Abort(_("unknown format %d") % format) 893 raise error.Abort(_("unknown format %d") % format)
894 894
895 generaldelta = r.version & revlog.REVLOGGENERALDELTA 895 generaldelta = r.version & revlog.FLAG_GENERALDELTA
896 if generaldelta: 896 if generaldelta:
897 basehdr = ' delta' 897 basehdr = ' delta'
898 else: 898 else:
899 basehdr = ' base' 899 basehdr = ' base'
900 900
1723 1723
1724 v = r.version 1724 v = r.version
1725 format = v & 0xFFFF 1725 format = v & 0xFFFF
1726 flags = [] 1726 flags = []
1727 gdelta = False 1727 gdelta = False
1728 if v & revlog.REVLOGNGINLINEDATA: 1728 if v & revlog.FLAG_INLINE_DATA:
1729 flags.append('inline') 1729 flags.append('inline')
1730 if v & revlog.REVLOGGENERALDELTA: 1730 if v & revlog.FLAG_GENERALDELTA:
1731 gdelta = True 1731 gdelta = True
1732 flags.append('generaldelta') 1732 flags.append('generaldelta')
1733 if not flags: 1733 if not flags:
1734 flags = ['(none)'] 1734 flags = ['(none)']
1735 1735