SCons: Fix bug with .hg dir not existing.
authorAli Saidi <saidi@eecs.umich.edu>
Thu, 5 Mar 2009 22:05:06 +0000 (17:05 -0500)
committerAli Saidi <saidi@eecs.umich.edu>
Thu, 5 Mar 2009 22:05:06 +0000 (17:05 -0500)
SConstruct

index a3cae0fc9f10fb6401f3a8c269112ba4ce7b31ea..a0f273aadbd26cfbd0b72536f1ef0ffcc0667b26 100644 (file)
@@ -211,17 +211,15 @@ If you are actually a M5 developer, please fix this and
 run the style hook. It is important.
 """
 
+hg_info = "Unknown"
 if hgdir.exists():
     # 1) Grab repository revision if we know it.
     cmd = "hg id -n -i -t -b"
     try:
         hg_info = read_command(cmd, cwd=env.root.abspath).strip()
     except OSError:
-        hg_info = "Unknown"
         print mercurial_bin_not_found
 
-    env['HG_INFO'] = hg_info
-
     # 2) Ensure that the style hook is in place.
     try:
         ui = None
@@ -240,6 +238,7 @@ if hgdir.exists():
             sys.exit(1)
 else:
     print ".hg directory not found"
+env['HG_INFO'] = hg_info
 
 ###################################################
 #