changeset 1346:88a9c75dc76a

Execute hooks in the repository root
author mpm@selenic.com
date Fri, 23 Sep 2005 19:46:12 -0700
parents c5594ff3f95c
children e89033eb90a5
files mercurial/localrepo.py
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/localrepo.py	Fri Sep 23 19:41:45 2005 -0700
+++ b/mercurial/localrepo.py	Fri Sep 23 19:46:12 2005 -0700
@@ -55,7 +55,11 @@
                 old[k] = os.environ.get(k, None)
                 os.environ[k] = v
 
+            # Hooks run in the repository root
+            olddir = os.getcwd()
+            os.chdir(self.root)
             r = os.system(s)
+            os.chdir(olddir)
 
             for k, v in old.items():
                 if v != None: