~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/foreign.py

  • Committer: Matt Nordhoff
  • Date: 2009-04-04 02:50:01 UTC
  • mfrom: (4253 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4256.
  • Revision ID: mnordhoff@mattnordhoff.com-20090404025001-z1403k0tatmc8l91
Merge bzr.dev, fixing conflicts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
17
 
18
18
"""Foreign branch utilities."""
41
41
    # Whether this mapping supports exporting and importing all bzr semantics.
42
42
    roundtripping = False
43
43
 
44
 
    # Prefix used when importing native foreign revisions (not roundtripped) 
 
44
    # Prefix used when importing native foreign revisions (not roundtripped)
45
45
    # using this mapping.
46
46
    revid_prefix = None
47
47
 
71
71
 
72
72
class VcsMappingRegistry(registry.Registry):
73
73
    """Registry for Bazaar<->foreign VCS mappings.
74
 
    
 
74
 
75
75
    There should be one instance of this registry for every foreign VCS.
76
76
    """
77
77
 
102
102
 
103
103
 
104
104
class ForeignRevision(Revision):
105
 
    """A Revision from a Foreign repository. Remembers 
 
105
    """A Revision from a Foreign repository. Remembers
106
106
    information about foreign revision id and mapping.
107
107
 
108
108
    """
142
142
 
143
143
    def show_foreign_revid(self, foreign_revid):
144
144
        """Prepare a foreign revision id for formatting using bzr log.
145
 
        
 
145
 
146
146
        :param foreign_revid: Foreign revision id.
147
147
        :return: Dictionary mapping string keys to string values.
148
148
        """
152
152
class ForeignVcsRegistry(registry.Registry):
153
153
    """Registry for Foreign VCSes.
154
154
 
155
 
    There should be one entry per foreign VCS. Example entries would be 
 
155
    There should be one entry per foreign VCS. Example entries would be
156
156
    "git", "svn", "hg", "darcs", etc.
157
 
    
 
157
 
158
158
    """
159
159
 
160
160
    def register(self, key, foreign_vcs, help):
169
169
        registry.Registry.register(self, key, foreign_vcs, help)
170
170
 
171
171
    def parse_revision_id(self, revid):
172
 
        """Parse a bzr revision and return the matching mapping and foreign 
 
172
        """Parse a bzr revision and return the matching mapping and foreign
173
173
        revid.
174
 
        
 
174
 
175
175
        :param revid: The bzr revision id
176
176
        :return: tuple with foreign revid and vcs mapping
177
177
        """
190
190
class ForeignRepository(Repository):
191
191
    """A Repository that exists in a foreign version control system.
192
192
 
193
 
    The data in this repository can not be represented natively using 
 
193
    The data in this repository can not be represented natively using
194
194
    Bazaars internal datastructures, but have to converted using a VcsMapping.
195
195
    """
196
196
 
200
200
    def has_foreign_revision(self, foreign_revid):
201
201
        """Check whether the specified foreign revision is present.
202
202
 
203
 
        :param foreign_revid: A foreign revision id, in the format used 
 
203
        :param foreign_revid: A foreign revision id, in the format used
204
204
                              by this Repository's VCS.
205
205
        """
206
206
        raise NotImplementedError(self.has_foreign_revision)
228
228
    def get_inventory_sha1(self, revision_id):
229
229
        """Get the sha1 for the XML representation of an inventory.
230
230
 
231
 
        :param revision_id: Revision id of the inventory for which to return 
 
231
        :param revision_id: Revision id of the inventory for which to return
232
232
         the SHA1.
233
233
        :return: XML string
234
234
        """