# Path: yoda/adapter/bzr.py
# class Bzr(Abstract):
#     """Bzr Adapter."""
#     executable = "bzr"
# 
#     def status(self):
#         """Show bzr status."""
#         return self.exec_on_path("%s status" % self.executable)
# 
#     def update(self):
#         """Update repository."""
#         return self.exec_on_path("%s pull" % self.executable)
# 
#     def clone(self, url):
#         """Clone repository from url."""
#         return self.execute("%s branch %s %s" % (self.executable,
#                                                  url, self.path))
# 
#     def show(self):
#         """Show repository details."""
#         raise NotImplemented("TODO: Not implemented")
# 
# Path: yoda/adapter/git.py
# class Git(Abstract):
#     """Git Adapter."""
# 
#     executable = "git"
# 
#     def status(self):
#         """Show git status."""
#         return self.exec_on_path("git status")
# 
#     def clone(self, url):
#         """Clone repository from url."""
#         return self.execute("git clone %s %s" % (url, self.path))
# 
#     def update(self):
#         """Update repository."""
#         return self.exec_on_path("git pull --rebase")
# 
#     def show(self):
#         """Show repository details."""
#         raise NotImplemented("TODO: Not implemented")
# 
# Path: yoda/adapter/hg.py
# class Hg(Abstract):
#     """Mercurial Adapter."""
#     executable = "hg"
# 
#     def status(self):
#         """Show hg status."""
#         return self.exec_on_path("%s status" % self.executable)
# 
#     def update(self):
#         """Update repository."""
#         return self.exec_on_path("%s pull -u" % self.executable)
# 
#     def clone(self, url):
#         """Clone repository from url."""
#         return self.execute("%s clone %s %s" % (self.executable,
#                                                 url, self.path))
# 
#     def show(self):
#         """Show repository details."""
#         raise NotImplemented("TODO: Not implemented")
# 
# Path: yoda/adapter/svn.py
# class Svn(Abstract):
#     """Svn Adapter."""
# 
#     executable = "svn"
# 
#     def status(self):
#         """Show git status."""
#         return self.exec_on_path("svn status")
# 
#     def clone(self, url):
#         """Checkout repository from url."""
#         return self.execute("svn checkout %s %s" % (url, self.path))
# 
#     def update(self):
#         """Update repository."""
#         return self.exec_on_path("svn update")
# 
#     def show(self):
#         """Show repository details."""
#         raise NotImplemented("TODO: Not implemented")


import os
from yoda.adapter import Bzr
from yoda.adapter import Git
from yoda.adapter import Hg
from yoda.adapter import Svn
        else:
            self.path = path
            if scm == ".git":
                self.adapter = Git(path)
            if scm == ".svn":
                self.adapter = Svn(path)
            if scm == ".bzr":
                self.adapter = Bzr(path)
            if scm == ".hg":
                self.adapter = Hg(path)

    def get_scm(self):
        """Get scm used as string."""
        if self.adapter is None:
            return None
        return self.adapter.__class__.__name__

    def status(self):
        return self.adapter.status()

    def update(self):
        return self.adapter.update()


def clone(url, path):
    """Clone a repository."""
    adapter = None
    if url[:4] == "git@" or url[-4:] == ".git":
        adapter = Git(path)
    if url[:6] == "svn://":

# Path: yoda/adapter/bzr.py
# class Bzr(Abstract):
#     """Bzr Adapter."""
#     executable = "bzr"
# 
#     def status(self):
#         """Show bzr status."""
#         return self.exec_on_path("%s status" % self.executable)
# 
#     def update(self):
#         """Update repository."""
#         return self.exec_on_path("%s pull" % self.executable)
# 
#     def clone(self, url):
#         """Clone repository from url."""
#         return self.execute("%s branch %s %s" % (self.executable,
#                                                  url, self.path))
# 
#     def show(self):
#         """Show repository details."""
#         raise NotImplemented("TODO: Not implemented")
# 
# Path: yoda/adapter/git.py
# class Git(Abstract):
#     """Git Adapter."""
# 
#     executable = "git"
# 
#     def status(self):
#         """Show git status."""
#         return self.exec_on_path("git status")
# 
#     def clone(self, url):
#         """Clone repository from url."""
#         return self.execute("git clone %s %s" % (url, self.path))
# 
#     def update(self):
#         """Update repository."""
#         return self.exec_on_path("git pull --rebase")
# 
#     def show(self):
#         """Show repository details."""
#         raise NotImplemented("TODO: Not implemented")
# 
# Path: yoda/adapter/hg.py
# class Hg(Abstract):
#     """Mercurial Adapter."""
#     executable = "hg"
# 
#     def status(self):
#         """Show hg status."""
#         return self.exec_on_path("%s status" % self.executable)
# 
#     def update(self):
#         """Update repository."""
#         return self.exec_on_path("%s pull -u" % self.executable)
# 
#     def clone(self, url):
#         """Clone repository from url."""
#         return self.execute("%s clone %s %s" % (self.executable,
#                                                 url, self.path))
# 
#     def show(self):
#         """Show repository details."""
#         raise NotImplemented("TODO: Not implemented")
# 
# Path: yoda/adapter/svn.py
# class Svn(Abstract):
#     """Svn Adapter."""
# 
#     executable = "svn"
# 
#     def status(self):
#         """Show git status."""
#         return self.exec_on_path("svn status")
# 
#     def clone(self, url):
#         """Checkout repository from url."""
#         return self.execute("svn checkout %s %s" % (url, self.path))
# 
#     def update(self):
#         """Update repository."""
#         return self.exec_on_path("svn update")
# 
#     def show(self):
#         """Show repository details."""
#         raise NotImplemented("TODO: Not implemented")


# Path: yoda/repository.py
import os
from yoda.adapter import Bzr
from yoda.adapter import Git
from yoda.adapter import Hg
from yoda.adapter import Svn

        else:
            self.path = path
            if scm == ".git":
                self.adapter = Git(path)
            if scm == ".svn":
                self.adapter = Svn(path)
            if scm == ".bzr":
                self.adapter = Bzr(path)
            if scm == ".hg":
                self.adapter = Hg(path)

    def get_scm(self):
        """Get scm used as string."""
        if self.adapter is None:
            return None
        return self.adapter.__class__.__name__

    def status(self):
        return self.adapter.status()

    def update(self):
        return self.adapter.update()


def clone(url, path):
    """Clone a repository."""
    adapter = None
    if url[:4] == "git@" or url[-4:] == ".git":
        adapter = Git(path)
    if url[:6] == "svn://":

        adapter = Svn(path)