+ lock.release()
+
+
+ def would_share(self):
+ if self.ismain():
+ return False, "Main version is always shared"
+
+ shared = self.shared()
+
+ # we just did this - move on
+ if self.parentof(shared):
+ return False, "Document has been recetly shared - no changes"
+
+ # *
+ # /|
+ # * *
+ # |\|
+ # | *
+ # | |
+ # Situation above is ok - what we don't want, is:
+ # *
+ # /|
+ # * |
+ # |\|
+ # | *
+ # | |
+ # We want to prevent stuff like this.
+ if self.parent().parentof(shared) and shared.parentof(self):
+ return False, "Preventing zig-zag"
+
+ return True, "All ok"