diff options
| author | Sebastian Thiel <byronimo@gmail.com> | 2011-06-07 21:36:42 +0200 |
|---|---|---|
| committer | Sebastian Thiel <byronimo@gmail.com> | 2011-06-07 21:36:42 +0200 |
| commit | 58a930a632c867b65b9a3802e2f4190cf32e33ee (patch) | |
| tree | 95b1311a3a4bfcdf4c2dba66f360e6985184013e /git/db/py/transport.py | |
| parent | a98e0af511b728030c12bf8633b077866bb74e47 (diff) | |
| parent | f6897c78be5a5530129df50742cb6cabfb8609c9 (diff) | |
| download | GitPython-58a930a632c867b65b9a3802e2f4190cf32e33ee.tar.gz GitPython-58a930a632c867b65b9a3802e2f4190cf32e33ee.zip | |
Merge branch 'gitdbmerger'
Diffstat (limited to 'git/db/py/transport.py')
| -rw-r--r-- | git/db/py/transport.py | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/git/db/py/transport.py b/git/db/py/transport.py new file mode 100644 index 00000000..00d222b0 --- /dev/null +++ b/git/db/py/transport.py @@ -0,0 +1,58 @@ +# Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors +# +# This module is part of GitDB and is released under +# the New BSD License: http://www.opensource.org/licenses/bsd-license.php +"""Implement a transport compatible database which sends objects using the git protocol""" + +from git.db.interface import ( TransportDB, + PushInfo, + FetchInfo, + RefSpec ) + +from git.refs.remote import RemoteReference +from git.remote import Remote + + +__all__ = ["PureTransportDB"] + +class PurePushInfo(PushInfo): + """TODO: Implementation""" + __slots__ = tuple() + + + +class PureFetchInfo(FetchInfo): + """TODO""" + __slots__ = tuple() + + +class PureTransportDB(TransportDB): + # The following variables need to be set by the derived class + #{Configuration + protocol = None + RemoteCls = Remote + #}end configuraiton + + #{ Interface + + def fetch(self, url, refspecs, progress=None, **kwargs): + raise NotImplementedError() + + def push(self, url, refspecs, progress=None, **kwargs): + raise NotImplementedError() + + @property + def remotes(self): + return self.RemoteCls.list_items(self) + + def remote(self, name='origin'): + return self.remotes[name] + + def create_remote(self, name, url, **kwargs): + return self.RemoteCls.create(self, name, url, **kwargs) + + def delete_remote(self, remote): + return self.RemoteCls.remove(self, remote) + + #}end interface + |
