mercurial/localrepo.py
changeset 2259 181b0643ffb1
parent 2232 ef3c039e7ab8
child 2264 fdb699b5e132
child 2267 d812d91c5a84
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -1544,8 +1544,9 @@ class localrepository(object):
                          " with %d changes to %d files%s\n")
                          % (changesets, revisions, files, heads))
 
-        self.hook('pretxnchangegroup', throw=True,
-                  node=hex(self.changelog.node(cor+1)), source=srctype)
+        if changesets > 0:
+            self.hook('pretxnchangegroup', throw=True,
+                      node=hex(self.changelog.node(cor+1)), source=srctype)
 
         tr.close()