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

Issue 12208138: Take Sam Elkhateeb's path for "path" dependencies and clean it up some. (Closed)

Created:
7 years, 10 months ago by Bob Nystrom
Modified:
7 years, 10 months ago
Reviewers:
nweiz
CC:
reviews_dartlang.org, Sam E
Visibility:
Public.

Description

Take Sam Elkhateeb's path for "path" dependencies and clean it up some. BUG=http://code.google.com/p/dart/issues/detail?id=3732 Committed: https://code.google.com/p/dart/source/detail?r=18465

Patch Set 1 #

Patch Set 2 : Remove a TODO. #

Total comments: 10

Patch Set 3 : Revise. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+394 lines, -121 lines) Patch
M utils/pub/io.dart View 1 2 1 chunk +1 line, -1 line 0 comments Download
A utils/pub/path_source.dart View 1 2 1 chunk +78 lines, -0 lines 0 comments Download
M utils/pub/system_cache.dart View 2 chunks +3 lines, -1 line 0 comments Download
M utils/pub/validator/dependency.dart View 2 chunks +8 lines, -1 line 0 comments Download
A utils/tests/pub/install/path/absolute_path_test.dart View 1 2 1 chunk +46 lines, -0 lines 0 comments Download
A utils/tests/pub/install/path/no_pubspec_test.dart View 1 chunk +32 lines, -0 lines 0 comments Download
A utils/tests/pub/install/path/nonexistent_dir_test.dart View 1 2 1 chunk +31 lines, -0 lines 0 comments Download
A utils/tests/pub/install/path/path_is_file_test.dart View 1 2 1 chunk +35 lines, -0 lines 0 comments Download
A utils/tests/pub/install/path/relative_path_test.dart View 1 2 1 chunk +25 lines, -0 lines 0 comments Download
M utils/tests/pub/test_pub.dart View 10 chunks +31 lines, -9 lines 0 comments Download
M utils/tests/pub/validator_test.dart View 6 chunks +104 lines, -109 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Bob Nystrom
I haven't added support for relative paths yet. I'll do that in a separate patch ...
7 years, 10 months ago (2013-02-12 22:11:16 UTC) #1
nweiz
A few suggestions, but LGTM. https://codereview.chromium.org/12208138/diff/2001/utils/pub/io.dart File utils/pub/io.dart (left): https://codereview.chromium.org/12208138/diff/2001/utils/pub/io.dart#oldcode318 utils/pub/io.dart:318: log.fine("Create symlink $from -> ...
7 years, 10 months ago (2013-02-13 00:13:56 UTC) #2
Bob Nystrom
7 years, 10 months ago (2013-02-13 18:28:36 UTC) #3
Thanks!

https://codereview.chromium.org/12208138/diff/2001/utils/pub/io.dart
File utils/pub/io.dart (left):

https://codereview.chromium.org/12208138/diff/2001/utils/pub/io.dart#oldcode318
utils/pub/io.dart:318: log.fine("Create symlink $from -> $to.");
On 2013/02/13 00:13:56, nweiz wrote:
> The fact that this plausibly makes sense both ways indicates that maybe it
> should be made more explicit. Maybe "Creating symlink ($to is a symlink to
> $from)".

Done.

https://codereview.chromium.org/12208138/diff/2001/utils/pub/path_source.dart
File utils/pub/path_source.dart (right):

https://codereview.chromium.org/12208138/diff/2001/utils/pub/path_source.dart...
utils/pub/path_source.dart:19: /// A package [Source] that installs packages
from a given local file path.
On 2013/02/13 00:13:56, nweiz wrote:
> Add a TODO here about supporting relative paths.

Done.

https://codereview.chromium.org/12208138/diff/2001/utils/pub/path_source.dart...
utils/pub/path_source.dart:49: String _validatePath(String name, String dir) {
On 2013/02/13 00:13:56, nweiz wrote:
> It seems like this should throw an error, which can be caught in install().

Done.

> Also it seems like it should be a FormatError.

Done.

> Why isn't this part of validateDescription?

Doing it there is a really blunt instrument. That gets called when a pubspec is
being parsed, which means pub wouldn't even load the root package if you have a
path dep to a non-existent file.

https://codereview.chromium.org/12208138/diff/2001/utils/pub/path_source.dart...
utils/pub/path_source.dart:61: "Was '$dir'.";
On 2013/02/13 00:13:56, nweiz wrote:
> Don't we usually indent continued strings four spaces? Are we changing our
> style?

Fixed. We do line up continued strings inside function calls often, like:

blahBlahBlah("some string that's really long "
             "here's the next line");

But we don't do that when it's just in a bare statement. Fixed as a side-effect
of throwing FormatException here.

https://codereview.chromium.org/12208138/diff/2001/utils/tests/pub/install/pa...
File utils/tests/pub/install/path/absolute_path_test.dart (right):

https://codereview.chromium.org/12208138/diff/2001/utils/tests/pub/install/pa...
utils/tests/pub/install/path/absolute_path_test.dart:21: "foo": {"path":
path.join(sandboxDir, "foo") }
On 2013/02/13 00:13:56, nweiz wrote:
> Style nit: no space between ")" and "}".

Done.

Powered by Google App Engine
This is Rietveld 408576698