Ejemplo n.º 1
0
 def createRepo(self):
     repopath =  self.getTempFolderPath()         
     repo = Repository(repopath, init = True)
     shpfile = os.path.join(os.path.dirname(__file__), "data", "shp", "landuse", "landuse2.shp")
     repo.importshp(shpfile, False, "landuse", "fid")
     repo.addandcommit("first")        
     return repo
Ejemplo n.º 2
0
 def createRepo(self):
     repopath = self.getTempFolderPath()
     repo = Repository(repopath, init=True)
     shpfile = os.path.join(os.path.dirname(__file__), "data", "shp",
                            "landuse", "landuse2.shp")
     repo.importshp(shpfile, False, "landuse", "fid")
     repo.addandcommit("first")
     return repo
Ejemplo n.º 3
0
 def testLargeDiff(self):
     repo = Repository(self.getTempRepoPath(), init=True)
     path = os.path.join(os.path.dirname(__file__), "data", "shp", "1", "parks.shp")
     repo.importshp(path)
     repo.addandcommit("message")
     path = os.path.join(os.path.dirname(__file__), "data", "shp", "elevation", "elevation.shp")
     repo.importshp(path)
     repo.addandcommit("message_2")
     s = repo.diff("HEAD~1", "HEAD")
Ejemplo n.º 4
0
 def testImportExportInDifferentFormats(self):
     repopath =  self.getTempFolderPath()         
     repo = Repository(repopath, init = True)
     geojsonfile = os.path.join(os.path.dirname(__file__), "data", "geojson", "landuse.geojson")
     repo.importgeojson(geojsonfile, False, "landuse", "fid")
     repo.addandcommit("commit")
     shpfile = os.path.join(self.getTempFolderPath(), "landuse.shp")
     repo.exportshp(geogig.HEAD, "landuse", shpfile)
     repo.importshp(shpfile, False, "landuse", "fid")
     unstaged = repo.unstaged()
     self.assertEquals(0, unstaged)
Ejemplo n.º 5
0
 def testImportExportInDifferentFormats(self):
     repopath = self.getTempFolderPath()
     repo = Repository(repopath, init=True)
     geojsonfile = os.path.join(os.path.dirname(__file__), "data",
                                "geojson", "landuse.geojson")
     repo.importgeojson(geojsonfile, False, "landuse", "fid")
     repo.addandcommit("commit")
     shpfile = os.path.join(self.getTempFolderPath(), "landuse.shp")
     repo.exportshp(geogig.HEAD, "landuse", shpfile)
     repo.importshp(shpfile, False, "landuse", "fid")
     unstaged = repo.unstaged()
     self.assertEquals(0, unstaged)
Ejemplo n.º 6
0
def createRepo():
    global _repo
    repo = Repository(getTempRepoPath(), init = True)
    path = os.path.join(os.path.dirname(__file__), "data", "shp", "1", "parks.shp")
    repo.importshp(path)   
    repo.addandcommit("message")
    path = os.path.join(os.path.dirname(__file__), "data", "shp", "2", "parks.shp")
    repo.importshp(path)
    repo.addandcommit("message_2")        
    path = os.path.join(os.path.dirname(__file__), "data", "shp", "3", "parks.shp")
    repo.importshp(path)
    repo.addandcommit("message_3")
    repo.createbranch(geogig.HEAD, "conflicted")
    repo.createbranch(geogig.HEAD, "unconflicted")
    path = os.path.join(os.path.dirname(__file__), "data", "shp", "4", "parks.shp")
    repo.importshp(path)
    repo.addandcommit("message_4")
    repo.checkout("conflicted")
    path = os.path.join(os.path.dirname(__file__), "data", "shp", "5", "parks.shp")
    repo.importshp(path)
    repo.addandcommit("message_5")
    repo.checkout("unconflicted")
    path = os.path.join(os.path.dirname(__file__), "data", "shp", "6", "parks.shp")
    repo.importshp(path)
    repo.addandcommit("message_6")
    repo.checkout(geogig.MASTER)
    repo.config(geogig.USER_NAME, "user")
    repo.config(geogig.USER_EMAIL, "user")
    _repo = repo    
Ejemplo n.º 7
0
def createRepo():
    global _repo
    repo = Repository(getTempRepoPath(), init=True)
    path = os.path.join(os.path.dirname(__file__), "data", "shp", "1",
                        "parks.shp")
    repo.importshp(path)
    repo.addandcommit("message")
    path = os.path.join(os.path.dirname(__file__), "data", "shp", "2",
                        "parks.shp")
    repo.importshp(path)
    repo.addandcommit("message_2")
    path = os.path.join(os.path.dirname(__file__), "data", "shp", "3",
                        "parks.shp")
    repo.importshp(path)
    repo.addandcommit("message_3")
    repo.createbranch(geogig.HEAD, "conflicted")
    repo.createbranch(geogig.HEAD, "unconflicted")
    path = os.path.join(os.path.dirname(__file__), "data", "shp", "4",
                        "parks.shp")
    repo.importshp(path)
    repo.addandcommit("message_4")
    repo.checkout("conflicted")
    path = os.path.join(os.path.dirname(__file__), "data", "shp", "5",
                        "parks.shp")
    repo.importshp(path)
    repo.addandcommit("message_5")
    repo.checkout("unconflicted")
    path = os.path.join(os.path.dirname(__file__), "data", "shp", "6",
                        "parks.shp")
    repo.importshp(path)
    repo.addandcommit("message_6")
    repo.checkout(geogig.MASTER)
    repo.config(geogig.USER_NAME, "user")
    repo.config(geogig.USER_EMAIL, "user")
    _repo = repo