summaryrefslogtreecommitdiffstats
path: root/subcmds/info.py
Commit message (Collapse)AuthorAgeFilesLines
* repo info findRemoteLocalDiff use short branchDaniel Kutik2020-05-121-2/+5
| | | | | | | | | | | | | When running repo info -d an error would be thrown saying: fatal: bad revision 'refs/remotes/m/refs/heads/master..' Using the short branch name here instead, like 'refs/remotes/m/master..' resolves this issue. Signed-off-by: Daniel Kutik <daniel.kutik@lavawerk.com> Change-Id: I50ea92c45c011b2c3e3a63803decb88e7837a380 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/266578 Reviewed-by: Mike Frysinger <vapier@google.com>
* Fix blank line issues reported by flake8David Pursehouse2020-02-121-1/+2
| | | | | | | | | | | | | | | | | | | | - E301 expected 1 blank line - E302 expected 2 blank lines - E303 too many blank lines - E305 expected 2 blank lines after class or function definition - E306 expected 1 blank line before a nested definition Fixed automatically with autopep8: git ls-files | grep py$ | xargs autopep8 --in-place \ --select E301,E302,E303,E305,E306 Manually fix issues in project.py caused by misuse of block comments. Change-Id: Iee840fcaff48aae504ddac9c3e76d2acd484f6a9 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/254599 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: David Pursehouse <dpursehouse@collab.net>
* Fix indentation issues reported by flake8David Pursehouse2020-02-121-5/+5
| | | | | | | | | | | | | | | | | | | | | - E121 continuation line under-indented for hanging indent - E122 continuation line missing indentation or outdented - E125 continuation line with same indent as next logical line - E126 continuation line over-indented for hanging indent - E127 continuation line over-indented for visual indent - E128 continuation line under-indented for visual indent - E129 visually indented line with same indent as next logical line - E131 continuation line unaligned for hanging indent Fixed automatically with autopep8: git ls-files | grep py$ | xargs autopep8 --in-place \ --select E121,E122,E125,E126,E127,E128,E129,E131 Change-Id: Ifd95fb8e6a1a4d6e9de187b5787d64a6326dd249 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/254605 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: David Pursehouse <dpursehouse@collab.net>
* Fix various whitespace issues reported by pyflakesDavid Pursehouse2020-02-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | - E201 whitespace after '[' - E202 whitespace before '}' - E221 multiple spaces before operator - E222 multiple spaces after operator - E225 missing whitespace around operator - E226 missing whitespace around arithmetic operator - E231 missing whitespace after ',' - E261 at least two spaces before inline comment - E271 multiple spaces after keyword Fixed automatically with autopep8: git ls-files | grep py$ | xargs autopep8 --in-place \ --select E201,E202,E221,E222,E225,E226,E231,E261,E271 Change-Id: I367113eb8c847eb460532c7c2f8643f33040308c Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/254601 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: David Pursehouse <dpursehouse@collab.net>
* Fix flake8 E251 unexpected spaces around keyword / parameter equalsDavid Pursehouse2020-02-121-5/+5
| | | | | | | | | | | Fixed automatically with autopep8: git ls-files | grep py$ | xargs autopep8 --in-place --select E251 Change-Id: I58009e1c8c91c39745d559ac919be331d4cd9e77 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/254598 Tested-by: David Pursehouse <dpursehouse@collab.net> Reviewed-by: Mike Frysinger <vapier@google.com>
* info: Fix formatting of block commentDavid Pursehouse2020-02-121-1/+1
| | | | | | | | | | | | | flake8 reports: E265 block comment should start with '# ' While we're at it, add a period at the end of the comment sentence. Change-Id: Icb7119079a1d64e6defafc3f6d24e99dbf16139d Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/254596 Tested-by: David Pursehouse <dpursehouse@collab.net> Reviewed-by: Mike Frysinger <vapier@google.com>
* info: Add the manifest revisionDiogo Ferreira2020-01-241-0/+4
| | | | | | | | | | | | | | After Ib546f5ebbc8a23875fbd14bf166fbe95b7dd244e, repo info now displays the current project revision in the 'Current revision' field. While the output is more consistent, there are use cases for the revision expression as shown in the manifest. This patch re-adds the manifest revision as a new 'Manifest revision' field. Change-Id: I50c1559dcb7ceb69af07352b956d78f85b8f592e Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/240799 Tested-by: Diogo Ferreira <deovferreira@gmail.com> Reviewed-by: Mike Frysinger <vapier@google.com>
* info: fix "current" outputMike Frysinger2019-10-051-2/+8
| | | | | | | | | | | | | The "Current revision" field shows the revision as listed in the manifest. I think most users expect this to show the revision that the git tree is checked out to instead. Switch the output to show that revision instead, and add a "Current branch" if it matches a local branch. Change-Id: Ib546f5ebbc8a23875fbd14bf166fbe95b7dd244e Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/239240 Reviewed-by: David Pursehouse <dpursehouse@collab.net> Tested-by: Mike Frysinger <vapier@google.com>
* info: allow NoSuchProjectError to bubble upMike Frysinger2019-10-011-5/+2
| | | | | | | | | | | If the user passes in bad projects like `repo info asdf`, we currently silently swallow those and do nothing. Allow NoSuchProjectError to bubble up to main which will handle & triage this correctly for us. Change-Id: Ie04528e7b7a164293063a636813a73eaabdd5bc3 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/239238 Reviewed-by: David Pursehouse <dpursehouse@collab.net> Tested-by: Mike Frysinger <vapier@google.com>
* set default file encoding to utf-8Mike Frysinger2019-06-131-0/+1
| | | | | | | | There's no reason to support any other encoding in these files. This only affects the files themselves and not streams they open. Bug: https://crbug.com/gerrit/10418 Change-Id: I053cb40cd3666ce5c8a0689b9dd938f24ca765bf
* tweak raise/dict syntax for Python 3 compatMike Frysinger2019-06-131-1/+1
| | | | | | | | | | | | | | | | Use the `raise` statement directly. Switch to using .items() instead of .iteritems(). Python 3 doesn't have .iteritems() as .items() is a generator, and these are small enough that the Python 2 overhead should be negligible. We have to run .keys() through list() in a few places as Python 3 uses a generator and we sometimes want to iterate more than once. That's why we don't change all .keys() or .items() calls -- most are in places where generators are fine. Bug: https://crbug.com/gerrit/10418 Change-Id: I469899d9b77ffd77ccabb831bc4b217407fefe6f
* info: Use the non-formatting printer for headtextSebastian Schuberth2019-04-171-1/+1
| | | | | | | | | | | | | | | | | If "repo init" was run in a path containing "%", "repo info" would fail printing the path with File ".repo/repo/color.py", line 173, in f return fmt % args TypeError: not enough arguments for format string as the "%" in the path name is interpreted as the start of a formatting specifier. Avoid that by using the non-formatting printer for headtext which does not require any formatting so there is no need to try to expand "%" sequences. Change-Id: Ie193b912191fe7cdabdce5c97bb100f0714f6e76 Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
* Prevent repo info from crashing when default element doesn't exist.Cassidy Burden2015-07-271-1/+2
| | | | | | | | repo info will crash when using a manifest with no default element despite default being an optional element. Output nothing for "Manifest Branch" if no default element exists (or if no default revision exists). Change-Id: I7ebffa2408863837ba980f0ab6e593134400aea9
* Remove unused show_smart option on list and info commandsDavid Pursehouse2013-05-161-1/+1
| | | | Change-Id: Idf0e161a0b0cc23a5a3ee44d18cb797162cfdd7b
* Some fixes for supporting python3Chirayu Desai2013-04-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | * Fix imports. * Use python3 syntax. * Wrap map() calls with list(). * Use list() only wherever needed. (Thanks Conley!) * Fix dictionary iteration methods (s/iteritems/items/). * Make use of sorted() in appropriate places * Use iterators directly in the loop. * Don't use .keys() wherever it isn't needed. * Use sys.maxsize instead of sys.maxint TODO: * Make repo work fully with python3. :) Some of this was done by the '2to3' tool [1], by applying the needed fixes in a way that doesn't break compatibility with python2. Links: [1]: http://docs.python.org/2/library/2to3.html Change-Id: Ibdf3bf9a530d716db905733cb9bfef83a48820f7 Signed-off-by: Chirayu Desai <cdesai@cyanogenmod.org>
* Add manifest groups to the output of `info`Conley Owens2013-03-071-1/+7
| | | | | | | | List the user's manifest groups when running `repo info`. These groups are passed to `repo init` using the -g/--groups flag. Change-Id: Ie8a4ed74a35b8b90df3b1ee198fe725b1cd68ae7
* Fix crash in repo info when `%` is used in commit messagesOlof Johansson2013-02-261-1/+1
| | | | | | | Fix for issue #131 http://code.google.com/p/git-repo/issues/detail?id=131 Change-Id: I078533ab5f3a83154c4ad6aa97a5525fc5139d20
* Fix: GitError when using repo info -dOlof Johansson2013-01-291-1/+1
| | | | | | | | | | | | | | | | | | If a workspace is initialised with: repo init -u git://path/to/manifest -b manifest-branch and the default.xml specifies the default revision as `other-branch`, running `repo info -d` results in a GitError: fatal: bad revision 'refs/remotes/m/other-branch..' The repo info command uses the default revision to build the symlink to the remote revision which is passed to the `git rev-list` command. This is incorrect; the manifest's branch name should be used. Change-Id: Ibae5b91869848276785facfaef433e38d49fd726
* Fix: missing spaces in info command outputDavid Pursehouse2013-01-291-3/+3
| | | | | | Text should be joined with " " rather than "" in the output. Change-Id: I6c5dddc15743e98c3b43702cb5d3ec32f81c3221
* Add repo info commandOlof Johansson2012-11-151-0/+195
The info command will print information regarding the current manifest and local git branch. It will also show the difference of commits between the local branch and the remote branch. It also incorporates an overview command into info which shows commits over all branches. Change-Id: Iafedd978f44c84d240c010897eff58bbfbd7de71