Kiln » Dependencies » Dulwich Read More
Clone URL:  
Pushed to one repository · View In Graph Contained in master

More docstrings.

Changeset f1262e1fcc35

Parent 4e5d3c28d26e

by Jelmer Vernooij

Changes to 3 files · Browse files at f1262e1fcc35 Showing diff from parent 4e5d3c28d26e Diff from another changeset...

Change 1 of 4 Show Entire File dulwich/​index.py Stacked
 
24
25
26
 
27
28
29
30
 
31
32
33
 
119
120
121
 
122
123
 
 
 
 
124
125
126
127
128
 
129
130
131
 
133
134
135
 
136
137
138
 
141
142
143
 
144
145
146
 
147
148
149
 
150
151
152
 
153
154
155
 
156
157
158
 
24
25
26
27
28
29
30
31
32
33
34
35
 
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
 
141
142
143
144
145
146
147
 
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
@@ -24,10 +24,12 @@
     def read_cache_time(f): + """Read a cache time."""   return struct.unpack(">LL", f.read(8))      def write_cache_time(f, t): + """Write a cache time."""   if isinstance(t, int):   t = (t, 0)   f.write(struct.pack(">LL", *t)) @@ -119,13 +121,19 @@
     class Index(object): + """A Git Index file."""     def __init__(self, filename): + """Open an index file. + + :param filename: Path to the index file + """   self._filename = filename   self.clear()   self.read()     def write(self): + """Write current contents of index to disk."""   f = open(self._filename, 'w')   try:   write_index_dict(f, self._byname) @@ -133,6 +141,7 @@
  f.close()     def read(self): + """Read current contents of index from disk."""   f = open(self._filename, 'r')   try:   for x in read_index(f): @@ -141,18 +150,23 @@
  f.close()     def __len__(self): + """Number of entries in this index file."""   return len(self._byname)     def __getitem__(self, name): + """Retrieve entry by relative path."""   return self._byname[name]     def __iter__(self): + """Iterate over the paths in this index."""   return iter(self._byname)     def get_sha1(self, path): + """Return the (git object) SHA1 for the object at a path."""   return self[path][-2]     def clear(self): + """Remove all contents from this index."""   self._byname = {}     def __setitem__(self, name, x):
 
15
16
17
 
 
 
 
18
19
20
 
15
16
17
18
19
20
21
22
23
24
@@ -15,6 +15,10 @@
 # along with this program; if not, write to the Free Software  # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,  # MA 02110-1301, USA. + + +"""Git object store interfaces and implementation.""" +    import itertools  import os
Change 1 of 4 Show Entire File dulwich/​server.py Stacked
 
16
17
18
 
 
 
 
19
20
21
 
88
89
90
 
91
92
93
 
98
99
100
 
101
102
103
 
170
171
172
 
173
174
175
 
16
17
18
19
20
21
22
23
24
25
 
92
93
94
95
96
97
98
 
103
104
105
106
107
108
109
 
176
177
178
179
180
181
182
@@ -16,6 +16,10 @@
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,  # MA 02110-1301, USA.   + +"""Git smart network protocol server implementation.""" + +  import SocketServer  import tempfile   @@ -88,6 +92,7 @@
     class Handler(object): + """Smart protocol command handler base class."""     def __init__(self, backend, read, write):   self.backend = backend @@ -98,6 +103,7 @@
     class UploadPackHandler(Handler): + """Protocol handler for uploading a pack to the server."""     def default_capabilities(self):   return ("multi_ack", "side-band-64k", "thin-pack", "ofs-delta") @@ -170,6 +176,7 @@
     class ReceivePackHandler(Handler): + """Protocol handler for downloading a pack to the client."""     def default_capabilities(self):   return ("report-status", "delete-refs")