mercurial/testing/storage.py
changeset 40047 8e398628a3f2
parent 40003 ad8389ecd3f5
child 40050 8e136940c0e6
equal deleted inserted replaced
40046:50700a025953 40047:8e398628a3f2
    15     nullrev,
    15     nullrev,
    16 )
    16 )
    17 from .. import (
    17 from .. import (
    18     error,
    18     error,
    19     mdiff,
    19     mdiff,
    20     revlog,
    20     repository,
    21 )
    21 )
    22 from ..utils import (
    22 from ..utils import (
    23     storageutil,
    23     storageutil,
    24 )
    24 )
    25 
    25 
   872         # different due to presence of censor metadata. But we can't
   872         # different due to presence of censor metadata. But we can't
   873         # do this with addrevision().
   873         # do this with addrevision().
   874         with self._maketransactionfn() as tr:
   874         with self._maketransactionfn() as tr:
   875             node0 = f.add(b'foo', None, tr, 0, nullid, nullid)
   875             node0 = f.add(b'foo', None, tr, 0, nullid, nullid)
   876             f.addrevision(stored1, tr, 1, node0, nullid,
   876             f.addrevision(stored1, tr, 1, node0, nullid,
   877                           flags=revlog.REVIDX_ISCENSORED)
   877                           flags=repository.REVISION_FLAG_CENSORED)
   878 
   878 
   879         self.assertTrue(f.iscensored(1))
   879         self.assertTrue(f.iscensored(1))
   880 
   880 
   881         self.assertEqual(f.revision(1), stored1)
   881         self.assertEqual(f.revision(1), stored1)
   882         self.assertEqual(f.revision(1, raw=True), stored1)
   882         self.assertEqual(f.revision(1, raw=True), stored1)
   912 
   912 
   913     def testaddrevisionunknownflag(self):
   913     def testaddrevisionunknownflag(self):
   914         f = self._makefilefn()
   914         f = self._makefilefn()
   915         with self._maketransactionfn() as tr:
   915         with self._maketransactionfn() as tr:
   916             for i in range(15, 0, -1):
   916             for i in range(15, 0, -1):
   917                 if (1 << i) & ~revlog.REVIDX_KNOWN_FLAGS:
   917                 if (1 << i) & ~repository.REVISION_FLAGS_KNOWN:
   918                     flags = 1 << i
   918                     flags = 1 << i
   919                     break
   919                     break
   920 
   920 
   921             with self.assertRaises(error.StorageError):
   921             with self.assertRaises(error.StorageError):
   922                 f.addrevision(b'foo', tr, 0, nullid, nullid, flags=flags)
   922                 f.addrevision(b'foo', tr, 0, nullid, nullid, flags=flags)