--- a/hgext/convert/hg.py Fri Jan 04 23:43:55 2008 +0100
+++ b/hgext/convert/hg.py Fri Jan 04 23:43:55 2008 +0100
@@ -46,11 +46,13 @@
self.filemapmode = False
def before(self):
+ self.ui.debug(_('run hg sink pre-conversion action\n'))
self.wlock = self.repo.wlock()
self.lock = self.repo.lock()
self.repo.dirstate.clear()
def after(self):
+ self.ui.debug(_('run hg sink post-conversion action\n'))
self.repo.dirstate.invalidate()
self.lock = None
self.wlock = None
@@ -274,3 +276,9 @@
'a')
self.convertfp.write('%s %s\n' % (destrev, rev))
self.convertfp.flush()
+
+ def before(self):
+ self.ui.debug(_('run hg source pre-conversion action\n'))
+
+ def after(self):
+ self.ui.debug(_('run hg source post-conversion action\n'))
--- a/tests/test-convert Fri Jan 04 23:43:55 2008 +0100
+++ b/tests/test-convert Fri Jan 04 23:43:55 2008 +0100
@@ -39,3 +39,8 @@
echo % should succeed
chmod 700 bogusdir
hg convert a bogusdir
+
+echo % test pre and post conversion actions
+echo 'include b' > filemap
+hg convert --debug --filemap filemap a partialb | \
+ grep 'run hg'
--- a/tests/test-convert.out Fri Jan 04 23:43:55 2008 +0100
+++ b/tests/test-convert.out Fri Jan 04 23:43:55 2008 +0100
@@ -112,3 +112,8 @@
2 c
1 d
0 e
+% test pre and post conversion actions
+run hg source pre-conversion action
+run hg sink pre-conversion action
+run hg sink post-conversion action
+run hg source post-conversion action