示例#1
0
 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)])
示例#2
0
 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)])
示例#3
0
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)
示例#4
0
 def run(self, args):
     opts, args = getopt(args, "", [])
     opts = dict(opts)
     for (obj, msg) in porcelain.fsck('.'):
         print("%s: %s" % (obj, msg))
示例#5
0
 def test_none(self):
     self.assertEqual(
             [],
             list(porcelain.fsck(self.repo)))
示例#6
0
 def test_none(self):
     self.assertEqual(
             [],
             list(porcelain.fsck(self.repo)))