summaryrefslogtreecommitdiffstats
path: root/subcmds/checkout.py
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* split out cli validation from executionv1.13.5Mike Frysinger2019-08-281-1/+2
| | | | | | | | | | | | | | | | | | | A common pattern in our subcommands is to verify the arguments & options before executing things. For some subcommands, that check stage is quite long which makes the execution function even bigger. Lets split that logic out of the execute phase so it's easier to manage these. This is most noticeable in the sync subcommand whose Execute func is quite large, and the option checking makes up ~15% of it. The manifest command's Execute can be simplified significantly as the optparse configuration always sets output_file to a string. Change-Id: I7097847ff040e831345e63de6b467ee17609990e Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/234834 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
* Change print statements to work in python3Sarah Owens2012-11-131-4/+4
| | | | | | This is part of a series of changes to introduce Python3 support. Change-Id: I373be5de7141aa127d7debdbce1df39148dbec32
* More coding style cleanupDavid Pursehouse2012-10-221-3/+3
| | | | | | | | | | | | | | | | Fixing more issues found with pylint. Some that were supposed to have been fixed in the previous sweep (Ie0db839e) but were missed: C0321: More than one statement on a single line W0622: Redefining built-in 'name' And some more: W0631: Using possibly undefined loop variable 'name' W0223: Method 'name' is abstract in class 'name' but is not overridden W0231: __init__ method from base class 'name' is not called Change-Id: Ie119183708609d6279e973057a385fde864230c3
* Fixed repo checkout error message when git reports errors.Doug Anderson2011-04-071-9/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the current version of repo checkout, we often get the error: error: no project has branch xyzzy ...even when the actual error was something else. This fixes it to only report the 'no project has branch' when that is actually true. This fix is very similar to one made for 'repo abandon': https://review.source.android.com/#change,22207 The repo checkout error is filed as: <http://crosbug.com/6514> TEST=manual A sample creating a case where 'git checkout' will fail: $ repo start branch1 . $ repo start branch2 . $ touch bogusfile $ git add bogusfile $ git commit -m "create bogus file" [branch2 f8b6b08] create bogus file 0 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 bogusfile $ echo "More" >> bogusfile $ repo checkout branch1 . error: chromite/: cannot checkout branch1 A sample case showing that we still fail if no project has a branch: $ repo checkout xyzzy . error: no project has branch xyzzy Change-Id: I48a8e258fa7a9c1f2800dafc683787204bbfcc63
* Improve checkout performance for the common unmodified caseShawn O. Pearce2009-04-181-10/+21
| | | | | | | | | Most projects will have their branch heads matching in all branches, so switching between them should be just a matter of updating the work tree's HEAD symref. This can be done in pure Python, saving quite a bit of time over forking 'git checkout'. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Cleanup checkout help to match other commandsShawn O. Pearce2009-04-131-4/+6
| | | | Signed-off-by: Shawn O. Pearce <sop@google.com>
* Add checkout command.Wink Saville2009-04-101-0/+45
Teach repo how to checkout a branch in all projects or a list of specific projects. Bug: REPO-21