+ def parent(self):
+ parents = self._changectx.parents()
+
+ if len(parents) == 1:
+ return self._library._revision(parents[0])
+
+ if parents[0].branch() == self.hgbranch():
+ return self._library._revision(parents[0])
+ else:
+ return self._library._revision(parents[1])
+