def exportFullRepo(repo, ref=geogig.HEAD): trees = repo.trees ref = repo.revparse(ref) for tree in trees: trackedlayer = getTrackingInfoForGeogigLayer(repo.url, tree.path) if trackedlayer is None or not os.path.exists(trackedlayer.source): filepath = os.path.join(repo.url, tree.path + ".shp") repo.exportshp(ref, tree.path, filepath, "utf-8") addTrackedLayer(filepath, repo.url, tree.path, ref) elif trackedlayer.ref != ref: repo.exportshp(ref, tree.path, trackedlayer.source, "utf-8") setRef(trackedlayer.source, ref)
def exportFullRepo(repo, ref = geogig.HEAD): trees = repo.trees ref = repo.revparse(ref) for tree in trees: trackedlayer = getTrackingInfoForGeogigLayer(repo.url, tree.path) if trackedlayer is None or not os.path.exists(trackedlayer.source): filepath = os.path.join(repo.url, tree.path + ".shp") repo.exportshp(ref, tree.path, filepath, "utf-8") addTrackedLayer(filepath, repo.url, tree.path, ref) elif trackedlayer.ref != ref: repo.exportshp(ref, tree.path, trackedlayer.source, "utf-8") setRef(trackedlayer.source, ref)
def exportFullRepo(repo, ref = geogig.HEAD): reponame = nameFromRepoPath(repo.url) repouser = userFromRepoPath(repo.url) repoowner = ownerFromRepoPath(repo.url) trees = repo.trees ref = repo.revparse(ref) for tree in trees: trackedlayer = getTrackingInfoForGeogigLayer(repo.url, tree.path) if trackedlayer is None or not os.path.exists(trackedlayer.source): filepath = os.path.join(repo.url, tree.path + ".shp") repo.exportshp(ref, tree.path, filepath) addTrackedLayer(filepath, reponame, repoowner, repouser, tree.path, ref) elif trackedlayer.ref != ref: repo.exportshp(ref, tree.path, trackedlayer.source) setRef(trackedlayer.source, ref)
dlg = CommitDialog(repo, iface.mainWindow()) dlg.exec_() try: repo.addandcommit(dlg.getMessage()) except UnconfiguredUserException, e: #It should not raise this exception unless config file has been manually deleted configdlg = UserConfigDialog(iface.mainWindow()) configdlg.exec_() if configdlg.user is not None: repo.config(geogig.USER_NAME, configdlg.user) repo.config(geogig.USER_EMAIL, configdlg.email) repo.commit(dlg.getMessage()) else: return headid = repo.revparse(geogig.HEAD) setRef(self.layer, headid) iface.messageBar().pushMessage("Repository correctly updated", level = QgsMessageBar.INFO, duration = 4) setInSync(self.layer, True) def _getFid(self, feature): try: return feature['geogigid'] except: raise Exception("No ID field found in layer") def doSmartUpdate(self, dest, repo): features = {} geomField = "geom"