aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libbe/bzr.py14
-rw-r--r--libbe/rcs.py12
2 files changed, 10 insertions, 16 deletions
diff --git a/libbe/bzr.py b/libbe/bzr.py
index b33292c..d7cd1e5 100644
--- a/libbe/bzr.py
+++ b/libbe/bzr.py
@@ -93,20 +93,6 @@ class Bzr(RCS):
assert len(match.groups()) == 1
revision = match.groups()[0]
return revision
- def postcommit(self):
- try:
- self._u_invoke_client('merge')
- except rcs.CommandError, e:
- if ('No merge branch known or specified' in e.err_str or
- 'No merge location known or specified' in e.err_str):
- pass
- else:
- self._u_invoke_client('revert', '--no-backup',
- directory=directory)
- self._u_invoke_client('resolve', '--all', directory=directory)
- raise
- if len(self._u_invoke_client('status', directory=directory)[1]) > 0:
- self.commit('Merge from upstream')
rcs.make_rcs_testcase_subclasses(Bzr, sys.modules[__name__])
diff --git a/libbe/rcs.py b/libbe/rcs.py
index 1e1cfa7..294b8e0 100644
--- a/libbe/rcs.py
+++ b/libbe/rcs.py
@@ -398,14 +398,22 @@ class RCS(object):
temp_file = os.fdopen(descriptor, 'wb')
temp_file.write(summary)
temp_file.flush()
+ self.precommit()
revision = self._rcs_commit(filename, allow_empty=allow_empty)
temp_file.close()
+ self.postcommit()
finally:
os.remove(filename)
return revision
- def precommit(self, directory):
+ def precommit(self):
+ """
+ Executed before all attempted commits.
+ """
pass
- def postcommit(self, directory):
+ def postcommit(self):
+ """
+ Only executed after successful commits.
+ """
pass
def _u_any_in_string(self, list, string):
"""