2059
2059
######################################################################
2060
2060
# results of operations
2062
class PullResult(object):
2063
class _Result(object):
2065
def _show_tag_conficts(self, to_file):
2066
if not getattr(self, 'tag_conflicts', None):
2068
to_file.write('Conflicting tags:\n')
2069
for name, value1, value2 in self.tag_conflicts:
2070
to_file.write(' %s\n' % (name, ))
2073
class PullResult(_Result):
2064
2075
def __int__(self):
2065
2076
# DEPRECATED: pull used to return the change in revno
2066
2077
return self.new_revno - self.old_revno
2069
class PushResult(object):
2080
class PushResult(_Result):
2081
"""Describes the result of a Branch.push operation"""
2071
2083
def __int__(self):
2072
2084
# DEPRECATED: push used to return the change in revno
2073
2085
return self.new_revno - self.old_revno
2087
def report(self, to_file):
2088
"""Write a human-readable description of the result."""
2089
if self.old_revid == self.new_revid:
2090
to_file.write('No new revisions to push.\n')
2092
to_file.write('Pushed up to revision %d.\n' % self.new_revno)
2093
self._show_tag_conficts(to_file)
2076
2096
class BranchCheckResult(object):
2077
2097
"""Results of checking branch consistency.