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) |