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

Issue 3331013: loman: tool for updating local_manifest (initial commit) (Closed)

Created:
10 years, 3 months ago by Mandeep Singh Baines
Modified:
9 years, 7 months ago
Reviewers:
kliegs, davidjames, sosa
CC:
chromium-os-reviews_chromium.org, anush, sosa, Mandeep Singh Baines
Visibility:
Public.

Description

loman: tool for updating local_manifest (initial commit) BUG=5787 TEST=Ran unittests. Change-Id: I6b8cc37eb2bf5f81f803f61b886106b6f08f3315

Patch Set 1 #

Total comments: 7

Patch Set 2 : Fixed per review. #

Total comments: 12

Patch Set 3 : Fix per review. #

Patch Set 4 : Fixed whitespace. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+208 lines, -0 lines) Patch
A bin/loman View 1 chunk +1 line, -0 lines 0 comments Download
A bin/loman.py View 1 2 3 1 chunk +96 lines, -0 lines 0 comments Download
A bin/loman_unittest.py View 1 1 chunk +111 lines, -0 lines 0 comments Download

Messages

Total messages: 8 (0 generated)
Mandeep Singh Baines
10 years, 3 months ago (2010-09-03 20:39:13 UTC) #1
sosa
http://codereview.chromium.org/3331013/diff/1/2 File bin/loman.py (right): http://codereview.chromium.org/3331013/diff/1/2#newcode15 bin/loman.py:15: def _FindRepoDir(): Is this a copy from repo.py? http://codereview.chromium.org/3331013/diff/1/2#newcode42 ...
10 years, 3 months ago (2010-09-03 20:51:28 UTC) #2
sosa
Missed your unittests. Also, you should add a symlink of bin/loman -> bin/loman.py http://codereview.chromium.org/3331013/diff/1/3 File ...
10 years, 3 months ago (2010-09-03 20:54:49 UTC) #3
Mandeep Singh Baines
Fixed. PTAL. On 2010/09/03 20:51:28, sosa wrote: > http://codereview.chromium.org/3331013/diff/1/2 > File bin/loman.py (right): > > ...
10 years, 3 months ago (2010-09-07 23:57:33 UTC) #4
Mandeep Singh Baines
ping
10 years, 3 months ago (2010-09-08 22:49:46 UTC) #5
sosa
Nits, o/w LGTM http://codereview.chromium.org/3331013/diff/1/2 File bin/loman.py (right): http://codereview.chromium.org/3331013/diff/1/2#newcode15 bin/loman.py:15: def _FindRepoDir(): On 2010/09/03 20:51:28, sosa ...
10 years, 3 months ago (2010-09-08 23:36:23 UTC) #6
kliegs
LGTM with nits/comments http://codereview.chromium.org/3331013/diff/7001/8002 File bin/loman.py (right): http://codereview.chromium.org/3331013/diff/7001/8002#newcode29 bin/loman.py:29: def __init__(self, text=None): Probably not worth ...
10 years, 3 months ago (2010-09-09 14:54:42 UTC) #7
Mandeep Singh Baines
10 years, 3 months ago (2010-09-09 21:49:27 UTC) #8
Fixed. PTAL.

http://codereview.chromium.org/3331013/diff/7001/8002
File bin/loman.py (right):

http://codereview.chromium.org/3331013/diff/7001/8002#newcode25
bin/loman.py:25: 
On 2010/09/08 23:36:23, sosa wrote:
> nit: two lines between top-level defs

Fixed.

http://codereview.chromium.org/3331013/diff/7001/8002#newcode27
bin/loman.py:27: """Class which provides an abstraction for manipulating the
local manifest"""
On 2010/09/08 23:36:23, sosa wrote:
> All your docstrings should end with a period

Fixed.

http://codereview.chromium.org/3331013/diff/7001/8002#newcode29
bin/loman.py:29: def __init__(self, text=None):
On 2010/09/09 14:54:42, kliegs wrote:
> Probably not worth fixing for here, but it seems if there is no text leaving
> text as None is the right thing to do.  And then have Parse check for None on
> self._text and create the tree using XML constructors rather than a handroll
of
> <manifest>\n</manifest>.

I'd rather have more common code. What you suggest seems more complex.

http://codereview.chromium.org/3331013/diff/7001/8002#newcode37
bin/loman.py:37: """Add a new workon project if it is not already in the
manifest."""
On 2010/09/08 23:36:23, sosa wrote:
> Since this is a public function, document the return (though it's always
> returning true)

Fixed.

http://codereview.chromium.org/3331013/diff/7001/8002#newcode44
bin/loman.py:44: def _AddProject(self, name, path, workon='False'):
On 2010/09/09 14:54:42, kliegs wrote:
> Instead of always adding to the root element should it confirm that its adding
> under a manifest tag?  If the xml doc gets extended in the future this would
> keep the script working.

Not sure I follow. If the DTD gets extended what you are suggesting MAY result
in this script still working. On the other hand, the current implementation MAY
also result in the script still working. It all depends on how the DTD gets
extended. The DTD is documented here:

http://android.git.kernel.org/?p=tools/repo.git;a=blob;f=docs/manifest_xml.tx...

http://codereview.chromium.org/3331013/diff/7001/8002#newcode83
bin/loman.py:83: print >> open(local_manifest, 'w'), ptree.ToString()
On 2010/09/09 14:54:42, kliegs wrote:
> Is it worth checking for an error on the write?  Python will likely stack
trace
> its own error but a more friendly/specific one might be useful.

Fixed.

Powered by Google App Engine
This is Rietveld 408576698