Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(947)

Issue 373003: Fix output reordering when you get a conflict on an update.... (Closed)

Created:
11 years, 1 month ago by Dirk Pranke
Modified:
9 years, 7 months ago
Reviewers:
M-A Ruel
CC:
chromium-reviews_googlegroups.com, M-A Ruel
Visibility:
Public.

Description

Fix output reordering when you get a conflict on an update. If you're not running gclient sync with --verbose and you get a conflict on a file, the conflict message prints *before* the message that you're running update in the appropriate directory. This is happening because we intercept stdout but not stderr, and the conflict prompt goes to stderr. redirecting stderr in the popen() to the pipe fixes this. R=maruel@chromium.org BUG=none TEST=none Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=31276

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+2 lines, -1 line) Patch
M gclient_utils.py View 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 2 (0 generated)
Dirk Pranke
11 years, 1 month ago (2009-11-05 23:01:59 UTC) #1
M-A Ruel
11 years, 1 month ago (2009-11-05 23:40:48 UTC) #2
lgtm

On Nov 5, 2009 6:02 PM, <dpranke@chromium.org> wrote:

Reviewers: Marc-Antoine Ruel,

Description:
Fix output reordering when you get a conflict on an update.

If you're not running gclient sync with --verbose and you get a conflict on
a file, the conflict message prints *before* the message that you're running
update in the appropriate directory. This is happening because we intercept
stdout but not stderr, and the conflict prompt goes to stderr. redirecting
stderr in the popen() to the pipe fixes this.

 R=maruel@chromium.org
 BUG=none
 TEST=none


Please review this at http://codereview.chromium.org/373003

SVN Base: svn://chrome-svn/chrome/trunk/tools/depot_tools/

Affected files:
 M     gclient_utils.py


Index: gclient_utils.py
===================================================================
--- gclient_utils.py    (revision 31140)
+++ gclient_utils.py    (working copy)
@@ -209,7 +209,8 @@
  # executable, but shell=True makes subprocess on Linux fail when it's
called
  # with a list because it only tries to execute the first item in the list.
  kid = subprocess.Popen(command, bufsize=0, cwd=in_directory,
-      shell=(sys.platform == 'win32'), stdout=subprocess.PIPE)
+      shell=(sys.platform == 'win32'), stdout=subprocess.PIPE,
+      stderr=subprocess.STDOUT)

  # Also, we need to forward stdout to prevent weird re-ordering of output.
  # This has to be done on a per byte basis to make sure it is not buffered:

Powered by Google App Engine
This is Rietveld 408576698