Bug 1274531 - replace backslashes in path to slashes; r?gps draft
authorLiang-Heng Chen <xeonchen@mozilla.com>
Fri, 20 May 2016 18:17:59 +0800
changeset 8160 d7712dedf5f837d07ac535bcd7c3c123a4219342
parent 8150 c03fab1721bd48fe584a1a9e2e6c8146e2c5d8dd
push id851
push userbmo:xeonchen@mozilla.com
push dateFri, 20 May 2016 10:40:20 +0000
reviewersgps
bugs1274531
Bug 1274531 - replace backslashes in path to slashes; r?gps MozReview-Commit-ID: FOjpFPOev73
git/commands/git-mozreview
--- a/git/commands/git-mozreview
+++ b/git/commands/git-mozreview
@@ -650,18 +650,18 @@ def configure_command(args):
     install_hook = True
 
     with open(source_hook, 'rb') as fh:
         source_content = fh.read()
 
     # Not all environments invoke `git` with the user's custom PATH. e.g.
     # Xcode. To avoid issues where the environment does have the PATH
     # set properly, encode the full path to `git-mozreview` in the hook.
-    source_content = re.sub('^git mozreview', __file__, source_content,
-                            flags=re.MULTILINE)
+    source_content = re.sub('^git mozreview', __file__.replace('\\', '/'),
+                            source_content, flags=re.MULTILINE)
 
     if os.path.exists(dest_hook):
         with open(dest_hook, 'rb') as fh:
             dest_content = fh.read()
             if 'MozReview' not in dest_content:
                 ui.warn('warning: existing commit-msg hook does not appear related '
                       'to MozReview; unable to install custom hook\n')
                 ui.warn('(MozReview may lose track of commits when rewriting)\n')