Exemplo n.º 1
0
    def run(self, args):
        opts, args = getopt(args, "", [])

        if args == []:
            print("Usage: dulwich dump-pack FILENAME")
            sys.exit(1)

        basename, _ = os.path.splitext(args[0])
        x = Pack(basename)
        print("Object names checksum: %s" % x.name())
        print("Checksum: %s" % sha_to_hex(x.get_stored_checksum()))
        if not x.check():
            print("CHECKSUM DOES NOT MATCH")
        print("Length: %d" % len(x))
        for name in x:
            try:
                print("\t%s" % x[name])
            except KeyError as k:
                print("\t%s: Unable to resolve base %s" % (name, k))
            except ApplyDeltaError as e:
                print("\t%s: Unable to apply delta: %r" % (name, e))
Exemplo n.º 2
0
 def test_reverse(self):
     self.assertEquals("abcd" * 10, sha_to_hex('\xab\xcd' * 10))
Exemplo n.º 3
0
 def test_reverse(self):
     self.assertEquals("abcd" * 10, sha_to_hex('\xab\xcd' * 10))