summaryrefslogtreecommitdiffstats
path: root/subcmds
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Revert "Implementation of manifest defined githooks"v1.12.20Jonathan Nieder2015-03-171-48/+1
| | | | | | | | | | | | | | | This reverts commit 38e4387f8eb8cffd6359d726c38a7c524fef07e3. A "repo init" followed by "repo sync" is meant to be as safe as "git clone". In particular it should not run arbitrary code provided by the manifest owner. It would still be nice to have support for manifest-defined git hooks --- they'd just need a prompt like the upload RepoHook has. Hopefully a later change can bring them back. Change-Id: I5ecd90fb5c2ed64f103d856d1ffcba38a47b062d Signed-off-by: Jonathan Nieder <jrn@google.com>
* Merge "Implementation of manifest defined githooks"Conley Owens2015-03-051-1/+48
|\
| * Implementation of manifest defined githooksJimmie Wester2015-02-031-1/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When working within a team or corporation it is often useful/required to use predefined git templates. This change teaches repo to use a per-remote git hook template structure. The implementation is done as a continuation of the existing projecthook functionality. The terminology is therefore defined as projecthooks. The downloaded projecthooks are stored in the .repo directory as a metaproject separating them from the users project forest. The projecthooks are downloaded and set up when doing a repo init and updated for each new repo init. When downloading a mirror the projecthooks gits are not added to the bare forest since the intention is to ensure that the latest are used (allows for company policy enforcement). The projecthooks are defined in the manifest file in the remote element as a subnode, the name refers to the project name on the server referred to in the remote. <remote name="myremote ..> <projecthook name="myprojecthookgit" revision="myrevision"/> </remote> The hooks found in the projecthook revision supersede the stock hooks found in repo. This removes the need for updating the projecthook gits for repo stock hook changes. Change-Id: I6796b7b0342c1f83c35f4b3e46782581b069a561 Signed-off-by: Patrik Ryd <patrik.ryd@stericsson.com> Signed-off-by: Ian Kumlien <ian.kumlien@gmail.com>
* | Add missing documentation of --current-branch option on sync commandDavid Pursehouse2015-01-291-0/+3
|/ | | | Change-Id: I72d6e3d51241148c1df97bbad26338debb1fcb4e
* pylint fixes for project.pyAnthony King2015-01-221-1/+1
| | | | | | Fix all the formatting warnings and unused variables Change-Id: I17d88a23572303879530077f3a80451de5417fbb
* If revision is sha hash and dest-branch is defined, use it for starting branchMax Liu2014-10-271-2/+6
| | | | Change-Id: I538c7d216f72b87629b61aee547d374a398c95da
* Merge "upload: report names of uncommitted files"Conley Owens2014-10-211-2/+6
|\
| * upload: report names of uncommitted filesVadim Bendebury2014-10-141-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When there are uncommitted files in the tree, 'repo upload' stops to ask if it is OK to continue, but does not report the actual names of uncommitted files. This patch adds plumbing to have the outstanding file names reported if desired. BUG=None TEST=verified that 'repo upload' properly operates with the following conditions present in the tree: . file(s) modified locally . file(s) added to index, but not committed . files not known to git . no modified files (the upload proceeds as expected) Change-Id: If65d5f8e8bcb3300c16d85dc5d7017758545f80d Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Signed-off-by: Vadim Bendebury <vbendeb@google.com>
* | Exit 1 if repo download -c failsScott Anderson2014-10-171-0/+1
|/ | | | Change-Id: I6985548bf87032b121eeccf858c4eeca1a60598c
* Allow selection of a target when using smart sync.Jeff Davidson2014-10-021-1/+4
| | | | Change-Id: I02a24471b9b62dbba3773f22a289825bc566acd9
* Merge "Provide detail print-out when not all projects of a branch are current."Conley Owens2014-08-261-3/+17
|\
| * Provide detail print-out when not all projects of a branch are current.Etan Cohen2014-07-111-3/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | When current is "split" (i.e. some projects are current while others are not): - Disable 'not in' printout (i.e. will print out all projects) - Disable printing of multiple projects on one line - Print current projects in green, non-current in white Since using color to differentiate current from non-current in "split" cases: - In non-split cases also print out project names in color (green for current white for non-current) Change-Id: Ia6b826612c708447cecfe5954dc767f7b2ea2ea7
* | Add --jobs option to forall subcommandTakeshi Kanemoto2014-06-241-113/+177
| | | | | | | | | | | | | | | | | | | | | | | | | | Enable '--jobs' ('-j') option in the forall subcommand. For -jn where n > 1, the '-p' option can no longer guarantee the continuity of console output between the project header and the output from the worker process. SIG_INT is sent to all worker processes upon keyboard interrupt (Ctrl+C). Bug: Issue 105 Change-Id: If09afa2ed639d481ede64f28b641dc80d0b89a5c
* | Merge "Define unicode as str if using Python 3"Conley Owens2014-05-071-2/+4
|\ \
| * | Define unicode as str if using Python 3Anthony King2014-05-061-2/+4
| |/ | | | | | | | | | | The unicode object was renamed to str in Python 3 Change-Id: I1e4972fb07b313d3462587b3059bb3638d779625
* | Use JSON instead of pickleAnthony King2014-05-071-26/+21
| | | | | | | | | | | | | | Use JSON as it is shown to be much faster than pickle. Also clean up the loading and saving functions. Change-Id: I45b3dee7b4d59a1c0e0d38d4a83b543ac5839390
* | 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
* Add total count and iteration count to forall environmentMitchel Humpherys2014-03-311-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | For long-running forall commands sometimes it's useful to know which iteration is currently running. Add REPO_I and REPO_COUNT environment variables to reflect the current iteration count as well as the total number of iterations so that the user can build simple status indicators. Example: $ repo forall -c 'echo $REPO_I / $REPO_COUNT; git gc' 1 / 579 Counting objects: 41, done. Delta compression using up to 8 threads. Compressing objects: 100% (19/19), done. Writing objects: 100% (41/41), done. Total 41 (delta 21), reused 41 (delta 21) 2 / 579 Counting objects: 53410, done. Delta compression using up to 8 threads. Compressing objects: 100% (10423/10423), done. Writing objects: 100% (53410/53410), done. Total 53410 (delta 42513), reused 53410 (delta 42513) 3 / 579 ... Change-Id: I9f28b0d8b7debe423eed3b4bc1198b23e40c0c50 Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
* Add reviewers automatically from project's git configbijia2014-03-041-3/+14
| | | | | | | | | | | The `review.URL.autocopy` setting sends email notification to the named reviewers, but does not add them as reviewer on the uploaded change. Add a new setting `review.URL.autoreviewer`. The named reviewers will be added as reviewer on the uploaded change. Change-Id: I3fddfb49edf346f8724fe15b84be8c39d43e7e65 Signed-off-by: bijia <bijia@xiaomi.com>
* Merge "Clean up duplicate logic in subcmds/sync.py."Conley Owens2014-02-281-49/+34
|\
| * Clean up duplicate logic in subcmds/sync.py.David James2014-02-141-49/+34
| | | | | | | | | | | | | | The fetch logic is now shared between the jobs == 1 and jobs > 1 cases. This refactoring also fixes a bug where opts.force_broken was not honored when jobs > 1. Change-Id: Ic886f3c3c00f3d8fc73a65366328fed3c44dc3be
* | Add the "diffmanifests" commandJulien Campergue2014-02-171-0/+195
| | | | | | | | | | | | | | | | | | This command allows a deeper diff between two manifest projects. In addition to changed projects, it displays the logs of the commits between both revisions for each project. Change-Id: I86d30602cfbc654f8c84db2be5d8a30cb90f1398 Signed-off-by: Julien Campergue <julien.campergue@parrot.com>
* | Add error message for download -c conflictsRob Ward2014-02-111-1/+7
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently if you run repo download -c on a change and the cherry-pick runs into a merge conflict a Traceback is produced: rob@rob-i5-lm ~/Programming/repo_test/repo1 $ repo download -c repo1 3/1 From ssh://rob-i5-lm:29418/repo1 * branch refs/changes/03/3/1 -> FETCH_HEAD error: could not apply 0c8b474... 2 hint: after resolving the conflicts, mark the corrected paths hint: with 'git add <paths>' or 'git rm <paths>' hint: and commit the result with 'git commit' Traceback (most recent call last): File "/home/rob/Programming/git-repo/main.py", line 408, in <module> _Main(sys.argv[1:]) File "/home/rob/Programming/git-repo/main.py", line 384, in _Main result = repo._Run(argv) or 0 File "/home/rob/Programming/git-repo/main.py", line 143, in _Run result = cmd.Execute(copts, cargs) File "/home/rob/Programming/git-repo/subcmds/download.py", line 90, in Execute project._CherryPick(dl.commit) File "/home/rob/Programming/git-repo/project.py", line 1943, in _CherryPick raise GitError('%s cherry-pick %s ' % (self.name, rev)) error.GitError: repo1 cherry-pick 0c8b4740f876f8f8372bbaed430f02b6ba8b1898 This amount of error message is confusing to users and has the side effect of the git message telling you the actual issue being ignored. This change introduces a message stating that the cherry-pick couldn't be completed removing the Traceback. To reproduce the issue create a change that causes a conflict with one currently in review and use repo download -c to cherry-pick the conflicting change. Change-Id: I8ddf4e0c8ad9bd04b1af5360313f67cc053f7d6a
* Add wrapper moduleConley Owens2014-01-301-2/+2
| | | | | | | | This takes the wrapper importing code from main.py and moves it into its own module so that other modules may import it without causing circular imports with main.py. Change-Id: I9402950573933ed6f14ce0bfb600f74f32727705
* Properly iterate through valuesv1.12.9Conley Owens2014-01-291-1/+1
| | | | | | | | | | | | | | | | | | | the value of Manifest.projects has changed from being the dictionary to the values of the dictionary. Here we handle this change correctly on a PostRepoUpgrade. From a `git diff v1.12.7 -- manifest_xml.py`: + @property def projects(self): self._Load() - return self._projects + return self._paths.values() self._paths does contain the projects according to this line of manifest_xml.py: 484 self._paths[project.relpath] = project Change-Id: I141f8d5468ee10dfb08f99ba434004a307fed810
* Merge "Don't backtrace when current branch is not uploadable."David Pursehouse2014-01-141-1/+10
|\
| * Don't backtrace when current branch is not uploadable.Warren Turkal2013-12-111-1/+10
| | | | | | | | | | | | | | | | | | The backtrace currently occurs when one uses the "--cbr" argument with the repo upload subcommand if the current branch is not tracking an upstream branch. There may be other cases that would backtrace as well, but this is the only one I found so far. Change-Id: Ie712fbb0ce3e7fe3b72769fca89cc4c0e3d2fce0
* | Merge "repo: Support multiple branches for the same project."Conley Owens2014-01-103-13/+48
|\ \
| * | repo: Support multiple branches for the same project.David James2013-10-143-13/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Add --archive option to init to sync using git archiveJulien Campergue2013-12-102-4/+28
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | This significantly reduces sync time and used brandwidth as only a tar of each project's revision is checked out, but git is not accessible from projects anymore. This is relevant when git is not needed in projects but sync speed/brandwidth may be important like on CI servers when building several versions from scratch regularly for example. Archive is not supported over http/https. Change-Id: I48c3c7de2cd5a1faec33e295fcdafbc7807d0e4d Signed-off-by: Julien Campergue <julien.campergue@parrot.com>
* | Remove trailing whitespaceChirayu Desai2013-11-211-1/+1
| | | | | | | | Change-Id: I56bcb559431277d40070fa33c580c6c3525ff9bc
* | Fix some python3 encoding issuesChirayu Desai2013-11-211-1/+1
| | | | | | | | | | | | * Add .decode('utf-8') where needed * Add 'b' to `open` where needed, and remove where unnecessary Change-Id: I0f03ecf9ed1a78e3b2f15f9469deb9aaab698657
* | Only check merge destination if it isn't Nonev1.12.6Conley Owens2013-10-151-9/+10
| | | | | | | | Change-Id: Ifb1dcd07142933489e93a1f4f03e38289087b609
* | Fix indentationv1.12.5David Pursehouse2013-10-151-7/+7
|/ | | | | | | git-repo uses 2 space indentation. A couple of recent changes introduced 4 space indentation in some modules. Change-Id: Ia4250157c1824c1b5e7d555068c4608f995be9da
* Don't upload when dest branch is not merge branchConley Owens2013-10-101-0/+29
| | | | | | | | | | | | Example: - `repo init -b master` / sync a project - In one project: `git checkout -b work origin/branch-thats-not-master` - make some changes, `git commit` - `repo upload .` - Upload will now be skipped with a warning instead of being uploaded to master Change-Id: I990b36217b75fe3c8b4d776e7fefa1c7d9ab7282
* don't pass project revision to UploadForReviewColin Cross2013-10-081-1/+1
| | | | | | | | | | | | | | | Passing a project revisionExpr to UploadForReview will cause it to try to push to refs/for/<sha> if the revision points to a sha instead of a branch. Pass None for dest_branch if no destination branch has been specified, which will cause UploadForReview to upload to the merge branch. There is room for further improvement, the user prompts will still print "Upload project <project> to remote branch <sha>", and then upload to the merge branch and not the sha, but that is the same behavior that was in 1.12.2. Change-Id: I06c510336ae67ff7e68b5b69e929693179d15c0b
* Sync: Improved error message when manifest server RPC call failsDavid Pursehouse2013-09-251-1/+2
| | | | | | | | | | | When the RPC call fails, the error message returned by the server is printed, but it is not obvious that this is caused by RPC call failure. Prefix the error message with a descriptive message that explains what went wrong. Change-Id: I4b77af22aacc2e9843c4df9d06bf54e41d9692ff
* Sync: Print name of manifest server used for smart sync/smart tagDavid Pursehouse2013-09-251-0/+2
| | | | | | | | | | When syncing using smart sync or smart tag mode, print the url of the manifest server that is being used. This is useful in organisations that have multiple manifest servers used in different manifest branches. Change-Id: Ib5bc2de5af6f4a942d0ef735c65cbc0721059a61
* upload: fix display of destination branch for SingleBranchChirayu Desai2013-06-281-1/+1
| | | | | | | | | | The command `repo upload --cbr -D <some branch>` will display the default revision, and not the actual destination branch. Fix that and display the branch to which the change will be uploaded to. Change-Id: I712ed0871c819dce6774c47254dac4efec4532e0
* Merge "sync: assign manifest_name earlier"David Pursehouse2013-06-111-1/+2
|\
| * sync: assign manifest_name earlierChirayu Desai2013-06-111-1/+2
| | | | | | | | | | | | | | | | | | | | | | * manifest_name was never set if opt.smart_sync or opt.smart_tag is used. * Set it earlier, so that the code handles it correctly when it is None. * An UnboundLocalError is raised if running `repo sync` without any options: local variable 'manifest_name' referenced before assignment * This fixes the above regression caused by commit 53a6c5d93a8ba708208826dab64c55fe97f06d0b Change-Id: I57086670f3589beea8461ce0344f6ec47ab85b7b
* | Fix urllib.parse (urlparse) handlingChirayu Desai2013-06-111-2/+2
|/ | | | | | | | | | | | | | | Revert "Fix "'module' object is not callable" error", and fix it properly. * The urlparse module is renamed to urllib.parse in Python 3. * This commit fixes the code to use "urllib.parse.urlparse" instead of creating a new module urlib and setting urlib.parse to urlparse.urlparse. * Fixes an AttributeError: 'function' object has no attribute 'uses_relative' This reverts commit cd51f17c643370e6199216462c1be36f04d57291. Change-Id: I48490b20ecd19cf5a6edd835506ea5a467d556ac
* Merge "Fix a few issues with dest-branch and multiples"Conley Owens2013-06-101-2/+4
|\
| * Fix a few issues with dest-branch and multiplesBryan Jacobs2013-06-031-2/+4
| | | | | | | | | | | | | | This fixes dest-branch display with >1 branch being uploaded to at once, and correctly handles setting the target branch in that case. Change-Id: If5e9c7ece02cc0d903e2cb377485ebea73a07107
* | Merge "Fix "'module' object is not callable" error"Conley Owens2013-06-101-1/+1
|\ \
| * | Fix "'module' object is not callable" errorDavid Pursehouse2013-06-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | In a couple of files the urlparse method was not being set up correctly for python < 3 and this resulted in an error being thrown when trying to call it. Change-Id: I4d2040ac77101e4e228ee225862f365ae3d96cec
* | | Degrade: Fix smart sync/smart tagVictor Boivie2013-06-081-3/+4
|/ / | | | | | | | | | | | | | | | | | | | | This was broken in b2bd91c, which updated the manifest after it had been overridden, which made it fall back to the original file (and not the one from the manifest server). This builds on 0766900 and overrides the manifest by the one downloaded from the manifest server completely. Change-Id: Ic3972390a68919b614616631d99c9e7a63c0e0db
* | Print project name for -p on mirror clientsJorge Gonzalez2013-06-031-1/+6
| | | | | | | | | | | | | | It doesn't make sense to print the relpath, since there's nothing checked out there and the dir shouldn't even exist. Change-Id: Id43631a8e0895929d3a5ad4ca8c2dc9e3d233e70
* | Fix a bug in repo upload --cbrBryan Jacobs2013-06-021-0/+2
|/ | | | | | | repo upload --cbr bailed out if some branches did not have modifications when it is used. Change-Id: I35f264ff7d77bb4bf8f26b4c3faffa184920b6c5