summaryrefslogtreecommitdiffstats
path: root/subcmds/rebase.py
Commit message (Collapse)AuthorAgeFilesLines
* avoid negative variablesMike Frysinger2020-02-191-2/+2
| | | | | | | | | | | Trying to use booleans with names like "no_xxx" are hard to follow due to the double negatives. Invert all of them so we only have positive meanings to follow. Change-Id: Ifd37d0368f97034d94aa2cf38db52c723ac0c6ed Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/255493 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: David Pursehouse <dpursehouse@collab.net>
* Fix indentation issues reported by flake8David Pursehouse2020-02-121-3/+3
| | | | | | | | | | | | | | | | | | | | | - 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>
* rebase: add basic coloring outputMike Frysinger2019-09-241-3/+20
| | | | | | | | | This uses coloring style like we use in grep/forall already. Change-Id: I317e2e47567a30c513083c48e7c7c40b091bb29a Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/238555 Reviewed-by: David Pursehouse <dpursehouse@collab.net> Tested-by: Mike Frysinger <vapier@google.com>
* rebase: add --fail-fast supportMike Frysinger2019-09-241-3/+16
| | | | | | | | | | | | Lets switch the default rebase behavior to align with our new sync behavior: we try to rebase all projects by default and exit/summarize things at the very end if there were any errors. Or if people want to exit immediately, they can use the new --fail-fast option. Change-Id: I436ac563f972b45de6ce9ad74da1e4870e584902 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/238553 Reviewed-by: David Pursehouse <dpursehouse@collab.net> Tested-by: Mike Frysinger <vapier@google.com>
* rebase: pull out project-independent settings from the for loopMike Frysinger2019-08-081-20/+16
| | | | | | | | | | | This makes the code a bit easier to read by doing all the project independent settings first instead of repeating it for every for loop iteration. Change-Id: I4ff21296e444627beba2f4b86561069f5e9a0d73 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/233554 Reviewed-by: David Pursehouse <dpursehouse@collab.net> Tested-by: Mike Frysinger <vapier@google.com>
* rebase/sync: use exit(1) for errors instead of exit(-1)Mike Frysinger2019-08-081-6/+6
| | | | | | | | | | | Callers don't actually see -1 (they'll usually see 255, but the exact answer here is complicated). Just switch to 1 as that's the standard value tools use to indicate an error. Change-Id: Ib712db1924bc3e5f7920bafd7bb5fb61f3bda44f Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/233553 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
* Add option to rebase onto project's manifest versionXiaohui Chen2016-01-281-0/+9
| | | | | | | | | | | | | Some teams have a continuous build server that would mark certain manifest green and safe to sync to. Then team members could repo sync to that particular manifest file and make sure they always sync to a green build. But if she/he has some local changes and wants to rebase, currently it would be a manual process to find the correct version to rebase onto. This patch helps with that use case by automating the process to rebase onto the currently synced manifest version. Change-Id: I847c9eb6addf7f84fd3f5594fbf8c0bcc103f9a5
* repo: Support multiple branches for the same project.David James2013-10-141-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | It is often useful to be able to include the same project more than once, but with different branches and placed in different paths in the workspace. Add this feature. This CL adds the concept of an object directory. The object directory stores objects that can be shared amongst several working trees. For newly synced repositories, we set up the git repo now to share its objects with an object repo. Each worktree for a given repo shares objects, but has an independent set of references and branches. This ensures that repo only has to update the objects once; however the references for each worktree are updated separately. Storing the references separately is needed to ensure that commits to a branch on one worktree will not change the HEAD commits of the others. One nice side effect of sharing objects between different worktrees is that you can easily cherry-pick changes between the two worktrees without needing to fetch them. Bug: Issue 141 Change-Id: I5e2f4e1a7abb56f9d3f310fa6fd0c17019330ecd
* Fix: Missing spaces in printed messagesDavid Pursehouse2013-03-051-1/+1
| | | | | | | | | | | | | | | | | | | | | Several messages are printed with the `print` method and the message is split across two lines, i.e.: print('This is a message split' 'across two source code lines') Which causes the message to be printed as: This is a message splitacross two source code lines Add a space at the end of the first line before the line break: print('This is a message split ' 'across two source code lines' Also correct a minor spelling mistake. Change-Id: Ib98d93fcfb98d78f48025fcc428b6661380cff79
* Change print statements to work in python3Sarah Owens2012-11-131-5/+9
| | | | | | This is part of a series of changes to introduce Python3 support. Change-Id: I373be5de7141aa127d7debdbce1df39148dbec32
* Coding style cleanupDavid Pursehouse2012-10-091-3/+3
| | | | | | | | | | | | | | | 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
* Remove unused importsDavid Pursehouse2012-08-231-2/+0
| | | | | | There are several imports that are not used. Remove them. Change-Id: I2ac3be66827bd68d3faedcef7d6bbf30ea01d3f2
* Support automatically stashing local modifications during repo-rebase.Joe Hansche2012-06-131-0/+21
| | | | | | | | | | | | | | | | | Currently repo-rebase requires that all modifications be committed locally before it will allow the rebase. In high-velocity environments, you may want to just pull in newer code without explicitly creating local commits, which is typically achieved using git-stash. If called with the --auto-stash command line argument, and it is determined that the current index is dirty, the local modifications are stashed, and the rebase continues. If a stash was performed, that stash is popped once the rebase completes. Note that there is still a possibility that the git-stash pop will result in a merge conflict. Change-Id: Ibe3da96f0b4486cb7ce8d040639187e26501f6af
* rebase: Pass through more optionsv1.6.10.1Shawn O. Pearce2010-07-151-7/+39
| | | | | | | | Passing through --whitespace=fix to rebase can be useful to clean up a branch prior to uploading it for review. Change-Id: Id85f1912e5e11ff9602e3b342c2fd7441abe67d7 Signed-off-by: Shawn O. Pearce <sop@google.com>
* rebase: Automatically rebase branch on upstreaDaniel Sandler2010-07-151-0/+75
Usage: repo rebase [[-i] <project>...] Rebases the current topic branch of the specified (or all) projects against the appropriate upstream. Note: Interactive rebase is currently only supported when exactly one project is specified on the command line. Change-Id: I7376e35f27a6585149def82938c1ca99f36db2c4 Signed-off-by: Shawn O. Pearce <sop@google.com>