Skip to content
This repository has been archived by the owner on Jun 4, 2020. It is now read-only.

Commit

Permalink
fix working copy pg local/distant when project was closed
Browse files Browse the repository at this point in the history
  • Loading branch information
lbartoletti committed Sep 14, 2018
1 parent 09039db commit 50bfab7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,11 @@ def on_legend_click(self, current, column=0):
ret = self.is_pgDistant(layer)
if ret:
try:
if not self.versioning:
out = self.selectDatabase()
(pg_conn_info_out, conn_dict) = self.get_conn_from_settings(out)
self.versioning = versioning.pgLocal(
pg_conn_info_out, uri.schema(), self.get_conn_from_uri(uri))
rev = self.versioning.revision()
selection_type = 'working copy'
self.info.setText(uri.database()+' '+uri.schema()
Expand All @@ -438,6 +443,10 @@ def on_legend_click(self, current, column=0):
# check if it's a working copy
rev = 0
try:
if not self.versioning:
self.versioning = versioning.pgServer(
self.pg_conn_info(), uri.schema())

rev = self.versioning.revision()
selection_type = 'working copy'
self.info.setText(uri.database()+' '+uri.schema()
Expand Down

0 comments on commit 50bfab7

Please sign in to comment.