changegroup hooks: add source to hook parameters
authorVadim Gelfer <vadim.gelfer@gmail.com>
Mon, 08 May 2006 16:07:56 -0700
changeset 2229 0ff326c2b286
parent 2228 8b106ff5b8a9
child 2230 332950340788
changegroup hooks: add source to hook parameters
mercurial/localrepo.py
--- a/mercurial/localrepo.py	Mon May 08 14:20:37 2006 -0700
+++ b/mercurial/localrepo.py	Mon May 08 16:07:56 2006 -0700
@@ -1469,7 +1469,7 @@
         if not source:
             return 0
 
-        self.hook('prechangegroup', throw=True)
+        self.hook('prechangegroup', throw=True, source=source)
 
         changesets = files = revisions = 0
 
@@ -1534,15 +1534,17 @@
                          % (changesets, revisions, files, heads))
 
         self.hook('pretxnchangegroup', throw=True,
-                  node=hex(self.changelog.node(cor+1)))
+                  node=hex(self.changelog.node(cor+1)), source=source)
 
         tr.close()
 
         if changesets > 0:
-            self.hook("changegroup", node=hex(self.changelog.node(cor+1)))
+            self.hook("changegroup", node=hex(self.changelog.node(cor+1)),
+                      source=source)
 
             for i in range(cor + 1, cnr + 1):
-                self.hook("incoming", node=hex(self.changelog.node(i)))
+                self.hook("incoming", node=hex(self.changelog.node(i)),
+                          source=source)
 
         return newheads - oldheads + 1