comparison hgext/convert/common.py @ 11134:33010ff1fd6f

convert: merge sources getmode() into getfile()
author Patrick Mezard <pmezard@gmail.com>
date Sun, 09 May 2010 21:52:34 +0200
parents 08a0f04b56bd
children 7e525d2f9a75
comparison
equal deleted inserted replaced
11133:d7b6aab612b4 11134:33010ff1fd6f
75 def getheads(self): 75 def getheads(self):
76 """Return a list of this repository's heads""" 76 """Return a list of this repository's heads"""
77 raise NotImplementedError() 77 raise NotImplementedError()
78 78
79 def getfile(self, name, rev): 79 def getfile(self, name, rev):
80 """Return file contents as a string. rev is the identifier returned 80 """Return a pair (data, mode) where data is the file content
81 by a previous call to getchanges(). Raise IOError to indicate that 81 as a string and mode one of '', 'x' or 'l'. rev is the
82 name was deleted in rev. 82 identifier returned by a previous call to getchanges(). Raise
83 """ 83 IOError to indicate that name was deleted in rev.
84 raise NotImplementedError()
85
86 def getmode(self, name, rev):
87 """Return file mode, eg. '', 'x', or 'l'. rev is the identifier
88 returned by a previous call to getchanges().
89 """ 84 """
90 raise NotImplementedError() 85 raise NotImplementedError()
91 86
92 def getchanges(self, version): 87 def getchanges(self, version):
93 """Returns a tuple of (files, copies). 88 """Returns a tuple of (files, copies).
190 and having listed parents. 'commit' is a commit object 185 and having listed parents. 'commit' is a commit object
191 containing at a minimum the author, date, and message for this 186 containing at a minimum the author, date, and message for this
192 changeset. 'files' is a list of (path, version) tuples, 187 changeset. 'files' is a list of (path, version) tuples,
193 'copies' is a dictionary mapping destinations to sources, 188 'copies' is a dictionary mapping destinations to sources,
194 'source' is the source repository, and 'revmap' is a mapfile 189 'source' is the source repository, and 'revmap' is a mapfile
195 of source revisions to converted revisions. Only getfile(), 190 of source revisions to converted revisions. Only getfile() and
196 getmode(), and lookuprev() should be called on 'source'. 191 lookuprev() should be called on 'source'.
197 192
198 Note that the sink repository is not told to update itself to 193 Note that the sink repository is not told to update itself to
199 a particular revision (or even what that revision would be) 194 a particular revision (or even what that revision would be)
200 before it receives the file data. 195 before it receives the file data.
201 """ 196 """