def test_git_dir(self): obj = Tree() a = Blob() a.data = b"foo" obj.add(b".git", 0o100644, a.id) self.repo.object_store.add_objects( [(a, None), (obj, None)]) self.assertEqual( [(obj.id, 'invalid name .git')], [(sha, str(e)) for (sha, e) in porcelain.fsck(self.repo)])
def gverify(ui, repo, **opts): '''verify that a Mercurial rev matches the corresponding Git rev Given a Mercurial revision that has a corresponding Git revision in the map, this attempts to answer whether that revision has the same contents as the corresponding Git revision. ''' if opts.get('fsck'): for badsha, e in porcelain.fsck(repo.githandler.git): raise error.Abort(b'git repository is corrupt!') ctx = scmutil.revsingle(repo, opts.get('rev'), b'.') return verify.verify(ui, repo, ctx)
def run(self, args): opts, args = getopt(args, "", []) opts = dict(opts) for (obj, msg) in porcelain.fsck('.'): print("%s: %s" % (obj, msg))
def test_none(self): self.assertEqual( [], list(porcelain.fsck(self.repo)))