summaryrefslogtreecommitdiffstats
path: root/subcmds/status.py
Commit message (Collapse)AuthorAgeFilesLines
* status: Use multiprocessing for `repo status -j<num>` instead of threadingKimiyuki Onaka2020-09-091-33/+15
| | | | | | | | | | | | | This change increases the speed of the command with parallelization with processes. The parallelization with threads doesn't work well, and increasing the number of jobs to many (8 threads ~) didn't increase the speed. Possibly, the global interpreter lock of Python affects. Bug: https://crbug.com/gerrit/12389 Change-Id: Icbe5df8ba037dd91422b96f4e43708068d7be924 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/279936 Tested-by: Kimiyuki Onaka <kimiyuki@google.com> Reviewed-by: Mike Frysinger <vapier@google.com>
* resort a few module imports to follow PEP8Mike Frysinger2020-02-181-5/+4
| | | | | | | | | All the stdlib imports are supposed to come before any local imports. Change-Id: I10c0335ba2ff715fd34c9eb91bfe6560e904df08 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/255593 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: David Pursehouse <dpursehouse@collab.net>
* Fix blank line issues reported by flake8David Pursehouse2020-02-121-0/+1
| | | | | | | | | | | | | | | | | | | | - 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-4/+4
| | | | | | | | | | | | | | | | | | | | | - 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 flake8 E251 unexpected spaces around keyword / parameter equalsDavid Pursehouse2020-02-121-2/+2
| | | | | | | | | | | 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>
* status: import print_functionMike Frysinger2019-06-141-0/+2
| | | | | | | | This module uses print() so make sure we import the print function. It doesn't really impact the current code due to the simple way it is calling print, but we should be sane to avoid future issues. Change-Id: I0b15344678c1dcb71207faa333c239b3fced1d62
* 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
* Add support for long pathsRenaud Paquay2018-10-221-1/+2
| | | | | | | | | | | | | | | | | | | | * Add more file i/o wrappers in platform_utils to allow using long paths (length > MAX_PATH) on Windows. * Paths using the long path syntax ("\\?\" prefix) should never escape the platform_utils API surface area, so that this specific syntax is not visible to the rest of the repo code base. * Forward many calls from os.xxx to platform_utils.xxx in various place to ensure long paths support, specifically when repo decides to delete obsolete directories. * There are more places that need to be converted to support long paths, this commit is an initial effort to unblock a few common use cases. * Also, fix remove function to handle directory symlinks Change-Id: If82ccc408e516e96ff7260be25f8fd2fe3f9571a
* update markdown/help header formatMike Frysinger2018-10-101-2/+1
| | | | | | | Since gitiles recommends using # headers over ---/=== underlines, change the manifest-format.md over and all our help texts. Change-Id: I96391d41fba769e9f26870d497cf7cf01c8d8ab3
* status: add -q/--quiet optionAndrew Wheeler2016-10-171-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | The --quiet option reduces the output to just a list of projects with modified workspaces (and orphans if -o is specified) A common use case is when performing a full-workspace merge. The integrator will kick-off a merge via: repo forall -c git merge <some tag> And then produce a short list of conflicted projects via: repo status -q The integrator can then iteratively fix and clean up all conficted components. The merge is complete when: repo status -q returns no output. Change-Id: Ibbba8713eac35befd8287c95948874e23fd5c7e2
* status: lose dependence on StringIOAnthony King2015-04-041-33/+15
| | | | | | | | | | | | | buflist was being used, which isn't available in Python 3. `Execute` was using StringIO to capture the output of `PrintWorkTreeStatus`, only to redirect it straight to stdout. Instead, just let `PrintWorkTreeStatus` do it's own thing directly to stdout. for handling `_FindOrphans`, we swap StringIO for a list. Nothing was done that needed a a file like object. Change-Id: Ibdaae137904de66a5ffb590d84203ef0fe782d8b
* Use next(iterator) rather than iterator.next()Anthony King2014-05-071-3/+3
| | | | | | | | iterator.next() was replaced with iterator.__next__() in Python 3. Use next(iterator) instead which will select the correct method for returning the next item. Change-Id: I6d0c89c8b32e817e5897fe87332933dacf22027b
* Move Python version checking to a separate moduleDavid Pursehouse2013-05-231-5/+6
| | | | | | | | | | | | | | | | | Add a new module with methods for checking the Python version. Instead of handling Python3 imports with try...except blocks, first check the python version and then import the relevant modules. This makes the code a bit cleaner and will result in less diff when/if we remove support for Python < 3 later. Use the same mechanism to handle `input` vs. `raw_input` and add suppression of pylint warnings caused by redefinition of the built-in method `input`. Change-Id: Ia403e525b88d77640a741ac50382146e7d635924 Also-by: Chirayu Desai <cdesai@cyanogenmod.org> Signed-off-by: Chirayu Desai <cdesai@cyanogenmod.org>
* Some fixes for supporting python3Chirayu Desai2013-04-181-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* 'repo status --orphans' shows non-repo filesWill Richey2013-01-291-0/+72
| | | | | | | | 'repo status --orphans' searches for non-repo objects (not within a project), which is particularly helpful before removing a working tree. Change-Id: I2239c12e6bc0447b0ad71129551cb50fa671961c
* Change print statements to work in python3Sarah Owens2012-11-131-1/+1
| | | | | | This is part of a series of changes to introduce Python3 support. Change-Id: I373be5de7141aa127d7debdbce1df39148dbec32
* Coding style cleanupDavid Pursehouse2012-10-091-4/+4
| | | | | | | | | | | | | | | Fix the following issues reported by pylint: C0321: More than one statement on a single line W0622: Redefining built-in 'name' W0612: Unused variable 'name' W0613: Unused argument 'name' W0102: Dangerous default value 'value' as argument W0105: String statement has no effect Also fixed a few cases of inconsistent indentation. Change-Id: Ie0db839e7c57d576cff12d8c055fe87030d00744
* Make "repo sync -j<count>" stop properly on Ctrl-C.David 'Digit' Turner2012-09-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | The threaded 'repo sync' implementation would very often freeze the process when interrupted by the user with Ctrl-C. The only solution being to kill -9 the process explicitly from another terminal. The reason for this is best explained here: http://snakesthatbite.blogspot.fr/2010/09/cpython-threading-interrupting.html This patch makes all helper sync threads 'daemon', which allows the process to terminate immediately on Ctrl-C. Note that this will forcefully kill all threads in case of interruption; this is generally a bad thing, but: 1/ This is equivalent to calling kill -9 in another terminal, which is the _only_ thing that can currently stop the process. 2/ There doesn't seem to be a way to tell the worker threads to gently stop when they are in a blocking operation anyway (even in the non-threaded case). + Do the same for "repo status -j<count>". Change-Id: Ieaf45b0eacee36f35427f8edafd87415c2aa7be4
* Avoid failing concat for multi-encoding filenamesCezary Baginski2012-05-241-2/+9
| | | | | | | | repo status should output filenames one by one instead of trying to build a string from incompatible encodings (like utf-8 and sjis filenames) Change-Id: I52282236ececa562f109f9ea4b2e971d2b4bc045
* repo status to print project name on clean gitsAli Utku Selen2012-03-121-13/+0
| | | | | | | | | | repo status just prints "# on branch oprofile" if you have branched in clean status. This doesn't really tell which branch is meant. Instead we can use the same syntax with modified gits which will give us detailed information. Change-Id: I55fe5154d278e10a814281dd2ba501ec6e956730
* Add option to check status of projects in parallel.Terence Haddock2011-04-071-6/+58
| | | | Change-Id: I6ac653f88573def8bb3d96031d3570ff966251ad
* Make 'repo status' show the branch you are currently onShawn O. Pearce2009-04-181-0/+13
| | | | Signed-off-by: Shawn O. Pearce <sop@google.com>
* Document 'repo status' outputShawn O. Pearce2009-04-131-0/+38
| | | | Signed-off-by: Shawn O. Pearce <sop@google.com>
* status: tell the user the working tree is cleanShawn O. Pearce2009-04-101-2/+9
| | | | | | | | | If there is nothing output at all, tell the user the working tree is completely clean. It just gives them a bit more of a warm-fuzzy feeling knowing repo and until the end. It also more closely matches with the output of git status. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Initial Contributionv1.0The Android Open Source Project2008-10-211-0/+27