Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(65)

Issue 5937043: code review 5937043: cmd/dist: don't fail when Mercurial is a batch file on ... (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
14 years, 2 months ago by snaury
Modified:
14 years, 2 months ago
Reviewers:
CC:
golang-dev, rsc, brainman, aram, Joe Poirier, mattn
Visibility:
Public.

Description

cmd/dist: don't fail when Mercurial is a batch file on Windows On windows Mercurial installed with easy_install typically creates an hg.bat batch file in Python Scripts directory, which cannot be used with CreateProcess unless full path is specified. Work around by launching hg via cmd.exe /c. Additionally, fix a rare FormatMessageW crash. Fixes issue 3093.

Patch Set 1 #

Patch Set 2 : diff -r 01acf1dbe91f https://go.googlecode.com/hg/ #

Patch Set 3 : diff -r 01acf1dbe91f https://go.googlecode.com/hg/ #

Total comments: 3

Patch Set 4 : diff -r 98fc21971a1d https://go.googlecode.com/hg/ #

Patch Set 5 : diff -r 98fc21971a1d https://go.googlecode.com/hg/ #

Patch Set 6 : diff -r 8434de733c20 https://go.googlecode.com/hg/ #

Patch Set 7 : diff -r 8434de733c20 https://go.googlecode.com/hg/ #

Patch Set 8 : diff -r 5e1544310d03 https://go.googlecode.com/hg/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+4 lines, -2 lines) Patch
M src/cmd/dist/windows.c View 1 2 3 4 5 6 7 2 chunks +4 lines, -2 lines 0 comments Download

Messages

Total messages: 40
snaury
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://go.googlecode.com/hg/
14 years, 2 months ago (2012-03-27 17:29:13 UTC) #1
rsc
We can look into this, but only after Go 1. The Go 1 release branch ...
14 years, 2 months ago (2012-03-27 18:14:18 UTC) #2
brainman
Please, add "Fixes issue 3093." to CL description. Alex http://codereview.appspot.com/5937043/diff/2001/src/cmd/dist/windows.c File src/cmd/dist/windows.c (right): http://codereview.appspot.com/5937043/diff/2001/src/cmd/dist/windows.c#newcode289 src/cmd/dist/windows.c:289: ...
14 years, 2 months ago (2012-03-28 01:39:43 UTC) #3
rsc
Let's wait on the review discussion until after Go 1. Thanks.
14 years, 2 months ago (2012-03-28 01:45:43 UTC) #4
snaury
Hello golang-dev@googlegroups.com, rsc@golang.org, alex.brainman@gmail.com (cc: golang-dev@googlegroups.com), Please take another look.
14 years, 2 months ago (2012-03-29 19:12:21 UTC) #5
snaury
On 2012/03/28 01:39:43, brainman wrote: > Please, add "Fixes issue 3093." to CL description. Done ...
14 years, 2 months ago (2012-03-29 19:16:18 UTC) #6
aram
> Well, I think it is generally advisable to use COMSPEC. Although unlikely, user > ...
14 years, 2 months ago (2012-03-29 19:30:59 UTC) #7
brainman
On 2012/03/29 19:16:18, snaury wrote: > ... > > I have one problem with your ...
14 years, 2 months ago (2012-03-30 01:29:26 UTC) #8
Joe Poirier
On Thu, Mar 29, 2012 at 8:29 PM, <alex.brainman@gmail.com> wrote: > On 2012/03/29 19:16:18, snaury ...
14 years, 2 months ago (2012-03-30 03:14:27 UTC) #9
mattn
http://codereview.appspot.com/5937043/diff/2001/src/cmd/dist/windows.c File src/cmd/dist/windows.c (right): http://codereview.appspot.com/5937043/diff/2001/src/cmd/dist/windows.c#newcode297 src/cmd/dist/windows.c:297: bwritestr(&cmd, " /c "); Shoud be " /c call ...
14 years, 2 months ago (2012-03-30 04:58:19 UTC) #10
mattn
Ah, typo. > Shoud be " /c call ". "cmd /c hg" can't get exit ...
14 years, 2 months ago (2012-03-30 04:59:30 UTC) #11
snaury
On 2012/03/30 01:29:26, brainman wrote: > I am not convinced. Could you, please, tell me ...
14 years, 2 months ago (2012-03-30 05:33:41 UTC) #12
snaury
On 2012/03/30 04:59:30, mattn wrote: > Shoud be " /c call ". "cmd /c hg" ...
14 years, 2 months ago (2012-03-30 05:39:14 UTC) #13
brainman
On 2012/03/30 05:33:41, snaury wrote: > > ... I just checked and it does not. ...
14 years, 2 months ago (2012-03-30 05:51:00 UTC) #14
snaury
On 2012/03/30 05:33:41, snaury wrote: > http://msdn.microsoft.com/en-us/library/277bwbdz.aspx > http://msdn.microsoft.com/en-us/library/ms404706.aspx Hmm, but then CreateProcess recommends cmd.exe. ...
14 years, 2 months ago (2012-03-30 05:51:41 UTC) #15
snaury
Hello golang-dev@googlegroups.com, rsc@golang.org, alex.brainman@gmail.com, aram@mgk.ro, jdpoirier@gmail.com, mattn.jp@gmail.com (cc: golang-dev@googlegroups.com), Please take another look.
14 years, 2 months ago (2012-03-30 05:51:42 UTC) #16
snaury
On 2012/03/30 05:51:00, brainman wrote: > I think it is big problem. We are executing ...
14 years, 2 months ago (2012-03-30 06:04:54 UTC) #17
snaury
Btw, hg.bat can be easily fixed by adding: if errorlevel 1 %COMSPEC% /c exit /b ...
14 years, 2 months ago (2012-03-30 06:13:37 UTC) #18
mattn
This is similar that I discused in golang-dev. https://groups.google.com/d/topic/golang-dev/ujtLlrp8e_c/discussion On Friday, March 30, 2012 3:13:37 ...
14 years, 2 months ago (2012-03-30 06:57:44 UTC) #19
snaury
On 2012/03/30 06:57:44, mattn wrote: > This is similar that I discused in golang-dev. > ...
14 years, 2 months ago (2012-03-30 20:49:44 UTC) #20
mattn
> Oh, interesting. Might be some artifact to allow parent interpreters > know exit code ...
14 years, 2 months ago (2012-03-31 14:18:25 UTC) #21
snaury
On 2012/03/31 14:18:25, mattn wrote: > I'm talking that go must handle exit code. To ...
14 years, 2 months ago (2012-03-31 14:47:05 UTC) #22
brainman
On 2012/03/30 06:04:54, snaury wrote: > > ... Exactly the same behavior happens with > ...
14 years, 2 months ago (2012-04-01 04:26:35 UTC) #23
brainman
On 2012/03/31 14:47:05, snaury wrote: > > I'm thinking about reworking this patch by porting ...
14 years, 2 months ago (2012-04-01 04:34:28 UTC) #24
rsc
I'm surprised that this works. If Alex is okay with it, fine. It looks like ...
14 years, 2 months ago (2012-04-02 16:15:32 UTC) #25
snaury
Hello golang-dev@googlegroups.com, rsc@golang.org, alex.brainman@gmail.com, aram@mgk.ro, jdpoirier@gmail.com, mattn.jp@gmail.com (cc: golang-dev@googlegroups.com), Please take another look.
14 years, 2 months ago (2012-04-02 20:56:21 UTC) #26
snaury
On 2012/04/02 16:15:32, rsc wrote: > I'm surprised that this works. If Alex is okay ...
14 years, 2 months ago (2012-04-02 20:59:48 UTC) #27
snaury
Oops, looks like I forgot to fight myself over if/for parentheses in a couple places. ...
14 years, 2 months ago (2012-04-02 21:03:04 UTC) #28
snaury
Hello golang-dev@googlegroups.com, rsc@golang.org, alex.brainman@gmail.com, aram@mgk.ro, jdpoirier@gmail.com, mattn.jp@gmail.com (cc: golang-dev@googlegroups.com), Please take another look.
14 years, 2 months ago (2012-04-02 21:08:01 UTC) #29
brainman
LGTM Thank you. Leaving for Russ. Alex
14 years, 2 months ago (2012-04-03 01:18:54 UTC) #30
rsc
What just happened? We went from a 12-line patch (patch set 3) to a 137-line ...
14 years, 2 months ago (2012-04-04 13:44:42 UTC) #31
brainman
On 2012/04/04 13:44:42, rsc wrote: > What just happened? We went from a 12-line patch ...
14 years, 2 months ago (2012-04-05 04:33:37 UTC) #32
rsc
I would like to do patch set 3. Russ
14 years, 2 months ago (2012-04-05 16:12:43 UTC) #33
snaury
On 2012/04/05 16:12:43, rsc wrote: > I would like to do patch set 3. > ...
14 years, 2 months ago (2012-04-09 18:59:27 UTC) #34
rsc
Either patch set 3 or patch set 5 would be fine. Both are small enough ...
14 years, 2 months ago (2012-04-09 19:01:29 UTC) #35
snaury
Hello golang-dev@googlegroups.com, rsc@golang.org, alex.brainman@gmail.com, aram@mgk.ro, jdpoirier@gmail.com, mattn.jp@gmail.com (cc: golang-dev@googlegroups.com), Please take another look.
14 years, 2 months ago (2012-04-09 19:07:22 UTC) #36
aram
I still don't understand why this works, how do we detect failure? Maybe we don't ...
14 years, 2 months ago (2012-04-09 19:14:07 UTC) #37
snaury
On 2012/04/09 19:14:07, aram wrote: > I still don't understand why this works, how do ...
14 years, 2 months ago (2012-04-09 19:26:25 UTC) #38
rsc
LGTM
14 years, 2 months ago (2012-04-09 19:39:44 UTC) #39
rsc
14 years, 2 months ago (2012-04-09 19:40:04 UTC) #40
*** Submitted as http://code.google.com/p/go/source/detail?r=9a55b03991e3 ***

cmd/dist: don't fail when Mercurial is a batch file on Windows

On windows Mercurial installed with easy_install typically creates
an hg.bat batch file in Python Scripts directory, which cannot be used
with CreateProcess unless full path is specified. Work around by
launching hg via cmd.exe /c.

Additionally, fix a rare FormatMessageW crash.

Fixes issue 3093.

R=golang-dev, rsc, alex.brainman, aram, jdpoirier, mattn.jp
CC=golang-dev
http://codereview.appspot.com/5937043

Committer: Russ Cox <rsc@golang.org>
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b