transplant: fix ignoring empty changesets (eg after filter)
authorBrendan Cully <brendan@kublai.com>
Tue, 20 Mar 2007 13:13:39 -0700
changeset 4251 e76e52145c3d
parent 4250 ca639faa38a2
child 4256 fe0fe0b4d73b
transplant: fix ignoring empty changesets (eg after filter)
hgext/transplant.py
--- a/hgext/transplant.py	Mon Mar 19 19:16:35 2007 -0300
+++ b/hgext/transplant.py	Tue Mar 20 13:13:39 2007 -0700
@@ -151,10 +151,10 @@
                                           log=opts.get('log'),
                                           filter=opts.get('filter'),
                                           lock=lock, wlock=wlock)
-                        if domerge:
+                        if n and domerge:
                             self.ui.status(_('%s merged at %s\n') % (revstr,
                                       revlog.short(n)))
-                        else:
+                        elif n:
                             self.ui.status(_('%s transplanted to %s\n') % (revlog.short(node),
                                                                        revlog.short(n)))
                     finally:
@@ -217,7 +217,7 @@
                                        files=files)
                     if not files:
                         self.ui.warn(_('%s: empty changeset') % revlog.hex(node))
-                        return
+                        return None
                 finally:
                     files = patch.updatedir(self.ui, repo, files, wlock=wlock)
             except Exception, inst: