Kiln » Dependencies » Dulwich Read More
Clone URL:  
Pushed to one repository · View In Graph Contained in master-1, master-0, and 0.9.4

Improve formatting.

Changeset cde18a4cdb36

Parent 155734ae7f6e

by Jelmer Vernooij

Changes to one file · Browse files at cde18a4cdb36 Showing diff from parent 155734ae7f6e Diff from another changeset...

 
1
 
2
3
4
 
17
18
19
 
 
 
 
20
21
22
 
45
46
47
 
48
49
50
51
52
53
 
54
55
56
57
 
58
59
60
 
 
1
2
3
4
 
17
18
19
20
21
22
23
24
25
26
 
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
@@ -1,4 +1,4 @@
-# objects.py -- Acces to base git objects +# objects.py -- Access to base git objects  # Copyright (C) 2007 James Westby <jw+debian@jameswestby.net>  # Copyright (C) 2008 Jelmer Vernooij <jelmer@samba.org>  # @@ -17,6 +17,10 @@
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,  # MA 02110-1301, USA.   + +"""Access to base git objects.""" + +  import mmap  import os  import sha @@ -45,16 +49,19 @@
  dcomped += dcomp.flush()   return dcomped   +  def sha_to_hex(sha):   """Takes a string and returns the hex of the sha within"""   hexsha = "".join(["%02x" % ord(c) for c in sha])   assert len(hexsha) == 40, "Incorrect length of sha1 string: %d" % hexsha   return hexsha   +  def hex_to_sha(hex):   """Takes a hex sha and returns a binary sha"""   assert len(hex) == 40, "Incorrent length of hexsha: %s" % hex   return ''.join([chr(int(hex[i:i+2], 16)) for i in xrange(0, len(hex), 2)]) +    class ShaFile(object):   """A git SHA file."""