summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* sync: use integer division with job countsMike Frysinger2019-06-141-2/+2
| | | | | | | | Neither of the fields here expect floats so make sure we use integer division when calculating things. Bug: https://crbug.com/gerrit/10418 Change-Id: Ibda068b16a7bba7ff3efba442c4bbff4415caa6e
* 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
* add license header to a few more filesMike Frysinger2019-06-132-0/+29
| | | | Change-Id: I24e6b1df5f15a8e71c0f4a9edac505a8902ec267
* repo: drop Python 3 warningMike Frysinger2019-06-131-4/+0
| | | | | | | Lets get people to start filing bugs :). Bug: https://crbug.com/gerrit/10418 Change-Id: I1d55bf0c60dbdbd6537d30b2cf9ea91d2928e387
* repo: restore use of print_functionMike Frysinger2019-06-131-89/+80
| | | | | | | | | | | We avoided this future import because Python 2.4 & 2.5 did not support it. We've dropped support for Python 2.6 at this point, and those versions are long dead. Since this workaround adds a bit of complexity to the codebase, drop it. Considering we are not running any actual tests against older versions, there's no sense in trying to support them anymore. Change-Id: Icda874861e8a8eb4fa07c624a9e7c5ee2a0da401
* set default file encoding to utf-8Mike Frysinger2019-06-1350-0/+53
| | | | | | | | 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-133-8/+8
| | | | | | | | | | | | | | | | 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
* repo: standardize help behaviorMike Frysinger2019-06-131-2/+2
| | | | | | | | | | Standard utilities exit normally/zero when users explicitly request --help, and they write to stdout. Exiting non-zero & using stderr is meant for incorrect tool usage instead. We're already doing this for `repo help <init|gitc-init>` calls, so lets fix `repo help` and `repo --help|-h` to match. Change-Id: Ia4f352b431c91eefef70dcafc11f00209ee69809
* wrapper: drop shebangMike Frysinger2019-06-131-2/+0
| | | | | | | | This isn't executable (+x), nor does it have a main func or code that would run if it were. It's simply an imported module like most others in here. Drop the shebang to avoid confusion. Change-Id: I5e2881eb1de5e809a3fa9e8f49220ed797034fb1
* Merge "docs: start a release document"Mike Frysinger2019-06-131-0/+167
|\
| * docs: start a release documentMike Frysinger2019-06-121-0/+167
| | | | | | | | Change-Id: I884639665c020338ec9ceeb1add5c3b862583674
* | diffmanifests: honor user-supplied manifest pathsBasil Gello2019-06-062-23/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current implementation ignores the user-specified paths to manifests. if the "repo diffmanifests" is invoked with absolute file paths for one or both manifests, the command fails with message: fatal: duplicate path ... in /tmp/manifest-old.xml Also the current implementation fails to expand the absolute path to manifest files if "repo diffmanifests" is invoked with relative paths, i.e "repo diffmanifests manifest-old.xml manifest-new.xml". fatal: manifest manifest-old.xml not found This commit fixes the first issue by disabling the local manifest discovery for diffmanifests command, and the second issue by expanding paths to manifests within "diffmanifests" sub-command. Test: repo manifest --revision-as-HEAD -o /tmp/manifest-old.xml repo sync repo manifest --revision-as-HEAD -o /tmp/manifest-new.xml repo diffmanifests /tmp/manifest-old.xml /tmp/manifest-new.xml Change-Id: Ia125d769bfbea75adb9aba81abbd8c636f2168d4 Signed-off-by: Vasyl Gello <vasek.gello@gmail.com>
* | Merge "platform_utils_win32: remove an unnecessary workaround"Jonathan Nieder2019-06-041-12/+5
|\ \ | |/ |/|
| * platform_utils_win32: remove an unnecessary workaroundРоман Донченко2019-03-211-12/+5
| | | | | | | | | | | | | | | | | | | | The comment in _create_symlink is incorrect. The return value of CreateSymbolicLink is as documented, it was just declared with the wrong return type. The actual return type is BOOLEAN, not BOOL. Fixing this allows us to simplify the code a bit. Change-Id: I4d2190a50d45ba41dd9814bf7079a5784fc0a366
* | project: Set config option to skip lfs process filterv1.13.3Francois Ferrand2019-05-241-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During sync, repo runs `git read-tree --reset -u -v HEAD` which causes git-lfs's smudge filter to run, which fails because git-lfs does not work with bare repositories. This was fixed in I091ff37998131e2e6bbc59aa37ee352fe12d7fcd to automatically disable this smudge filter. However, later versions of Git (2.11.0) introduced a new filter protocol [1], to avoid spawning a new command for each filtered file. This was implemented in Git-LFS 1.5.0 [2]. This patch fixes the issue by setting the git lfs process filter, in addition to the smudge filter. For any projects that have LFS objects, `git lfs pull` must still be executed manually afterwards. [1] https://github.com/git/git/commit/edcc85814c87ebd7f3b1b7d3979fac3dfb84d308 [2] https://github.com/git-lfs/git-lfs/pull/1617 Bug: https://crbug.com/gerrit/10911 Change-Id: I277fc68fdefc91514a2412b3887e3be9106cab48
* | Honor --depth during repo initNasser Grainawi2019-05-211-2/+2
| | | | | | | | | | | | | | | | | | | | | | If a user is asking for a shallow clone of the repos, they probably expect a shallow clone of the manifest repo too. For very large manifest repos, this can be a huge space and time savings. For one real-world repo, a 'repo init --no-tags --current-branch' used 350MB of disk space and took 7 minutes. Adding --depth 1 and this change reduced it to 10MB and 2.5 minutes. Change-Id: I6fa662e174e623ede8861efc862ce26d65d4958d
* | Merge "Print project name when work tree initialization fails"Jonathan Nieder2019-05-161-1/+1
|\ \
| * | Print project name when work tree initialization failsMikhail Naganov2019-05-091-1/+1
| | | | | | | | | | | | | | | | | | | | | When syncing a lot of projects in parallel, it is not otherwise clear which one of them has failed to init work tree. Change-Id: I8edfb4955023389a499e99cfa511bdc0d2850ba2
* | | Use %topic=topic instead of deprecated /topic syntax on pushDavid Pursehouse2019-05-151-2/+3
|/ / | | | | | | | | Bug: https://crbug.com/gerrit/9930 Change-Id: Iefa202d42ef6e6b8b2b1a3f9b8baa5f0d65cbd60
* | Ignore submodules when calculating 'git diff-files'Eli Ribble2019-05-021-0/+1
| | | | | | | | | | | | | | | | | | | | | | This allows projects to include submodules inside of projects that use repo without repo incorrectly believing the area is dirty just because a submodule has updates. This is in line with git porcelain commands which generally require a commandline flag to include submodules (git add, git rebase). Change-Id: Ide8a292162a42ab35145b5c4ca8ca0d020cdfe81
* | 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>
* | Don't print "persistent ref" message when syncing quietlyTim Schumacher2019-04-151-2/+3
| | | | | | | | | | | | | | | | | | The newly introduced "Already have persistent ref" message prevents repo from overwriting the last line when syncing quietly. Omit the message when syncing quietly to clean up the output and to restore the previous behaviour. Change-Id: Idf42751c67f95924d6de50092ba54d4c6fe93096
* | sync: deleted unused repos in reversed order (children before parent)Kuang-che Wu2019-04-061-1/+2
|/ | | | | Bug: chromium:950002 Test: repo sync chromeos using release manifest file Change-Id: I613df6a1973eb36acd806a703e72f5172554bcc7
* sync: respect --force-sync when fetching updatesMike Frysinger2019-03-181-2/+6
| | | | | | | | | | | | | | | | | | If a tag is rewritten on the server (which is bad), trying to recover locally with `repo sync --force-sync` doesn't actually work. People have to manually delete things themselves to fix syncing. While tags should never be rewritten in practice, allow users to easily recover from broken servers. We updated some of these code paths already (see commit 6e53844f1edd3 "Allow clobbering of existing tags from remote."), but the incremental update flow was missed. Bug: b/120778183 Bug: chromium:932651 Test: delete local tag & recreate to diff commit, then check `repo sync` & `repo sync --force-sync` behavior Change-Id: I3648f7d2526732c06016b691a9a36c003157618d
* docs: fixed typo error.Kyunam Jo2019-03-181-1/+1
| | | | Change-Id: Ic3ec1bfb150ec932e05ba5eda43537784f1fdcda
* Merge "project: Relax the submodule name pattern to accept dots"Sebastian Schuberth2019-03-141-2/+2
|\
| * project: Relax the submodule name pattern to accept dotsSebastian Schuberth2019-03-111-2/+2
| | | | | | | | | | | | | | | | Even if dots are used as separators for Git config keys, they are not forbidden as part of submodule names. This fixes the issue of submodules with a name like e.g. "long.js" to be skipped from checkout. Change-Id: I77da07925ad207fa3d043067dfbbcb4a1ebdac4d
* | Merge "sync: Add option '--force-remove-dirty'"Oleksii Okolielov2019-03-111-3/+17
|\ \ | |/ |/|
| * sync: Add option '--force-remove-dirty'Oleksii Okolielov2019-03-111-3/+17
| | | | | | | | | | | | | | | | | | | | Forcefully remove dirty projects if option '--force-remove-dirty' is given. The '--force-remove-dirty' option can be used to remove previously used projects with uncommitted changes. WARNING: This may cause data to be lost since uncommitted changes may be removed with projects that no longer exist in the manifest. Change-Id: I844a6e943ded522fdc7b1b942c0a1269768054bc
* | docs: document a Python 3 migration planMike Frysinger2019-02-011-0/+32
| | | | | | | | | | Bug: https://crbug.com/gerrit/10418 Change-Id: I72d82ce3a2d9af45d942bb10de82340110864ea5
* | event_log: turn id generation from a generator to a func callv1.13.2Mike Frysinger2019-01-141-12/+11
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | Running lots of sync processes in parallel can hit the failure: Fetching projects: 23% (124/523)Exception in thread Thread-201: Traceback (most recent call last): File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner self.run() File "/usr/lib/python2.7/threading.py", line 754, in run self.__target(*self.__args, **self.__kwargs) File "/usr/local/src/repo/subcmds/sync.py", line 278, in _FetchProjectList success = self._FetchHelper(opt, project, *args, **kwargs) File "/usr/local/src/repo/subcmds/sync.py", line 357, in _FetchHelper start, finish, success) File "/usr/local/src/repo/event_log.py", line 104, in AddSync event = self.Add(project.relpath, task_name, start, finish, success) File "/usr/local/src/repo/event_log.py", line 74, in Add 'id': (kind, next(self._next_id)), ValueError: generator already executing It looks like, while we lock the multiprocessing value correctly, the generator that wraps the value isn't parallel safe. Since we don't have a way of doing that (as it's part of the language), turn it into a plain function call instead. Bug: https://crbug.com/gerrit/10293 Change-Id: I0db03601986ca0370a1699bab32adb03e7b2910a
* init: Remove -c short option for --current-branchv1.13.1Ereth McKnight-MacNeil2018-12-202-3/+3
| | | | | | | This option conflicts with the gitc-init -c short option. Bug: https://crbug.com/gerrit/10200 Change-Id: I06f37564429ca0bd4c0bbea6066daae4f663c838
* Merge "README: link in new bug tracker"Mike Frysinger2018-12-201-1/+1
|\
| * README: link in new bug trackerMike Frysinger2018-12-201-1/+1
| | | | | | | | Change-Id: I043afc0b77e709919e49ce548dff47776fddaddf
* | Leverage the next keyword from python 2.7Eli Ribble2018-12-193-9/+10
|/ | | | | | | This is literally what the next keyword is for. https://www.python.org/dev/peps/pep-3114/ Change-Id: I843755910b847737b077ff2361ba3e04409db0f0
* Allow clobbering of existing tags from remote.v1.13.0Xin Li2018-12-102-2/+2
| | | | | Bug: 120778183 Change-Id: Id44e2b68abc410a3afd4e07a3c943b0936347e38
* platform_utils: Fix exception handling in _walk_windows_implDavid Pursehouse2018-11-061-1/+1
| | | | Change-Id: I6b79cbc4c1bbbe17ffe8361fe1544434beaa9059
* Add option for git-repo to support 'silent' uploadsVadim Bendebury2018-11-052-0/+9
| | | | | | | | | | | | | | | | | | | When --ne/--no-emails is added to 'repo upload' command line, gerrit server will not generate notification emails. project.py:Project.UploadForReview method is modified to accept a string recognizable by gerrit to indicate different sets of destination email addressees, but the upload command line allows only one option - disable sending emails completely. Default repo upload behavior is not being changed. TEST=tried in the Chrome OS repo, observed that patches uploaded with --ne or --no-emails indeed do not trigger any emails, while patches uploaded without these command line options still trigger email notifications. Change-Id: I0301edec984907aedac277d883bd0e6d3099aedc
* upload: Unify option passing in ssh and other transportsJonathan Nieder2018-11-051-15/+9
| | | | | | | | | | | | Pass options through the refspec for all transports, including ssh. This means the behavior will be more consistent between the ssh and https cases. A downside is that this prevents passing special characters in reviewer options. That already didn't work over https, so it seems okay. It could be fixed by using push options instead. Change-Id: Ia38d16e350cb8cb0de14463bfb3d9724e13bc4bf
* Merge "init: --dissociate option to copy objects borrowed with --reference"David Pursehouse2018-10-283-0/+24
|\
| * init: --dissociate option to copy objects borrowed with --referenceNikolai Merinov2018-10-193-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "repo init --reference" has two purposes: to decrease bandwidth used at clone time, and to decrease disk usage afterward, by using the reference repositories as an alternate store of objects even after the clone. The downside is that it makes the borrowing repositories dependent on the reference repositories, so it is easy to end up with missing objects by mistake after a cleanup operation like "git gc". To prevent that, v2.3.0-rc0~30^2 (clone: --dissociate option to mark that reference is only temporary, 2014-10-14), "git clone" gained a --dissociate option that makes --reference reuse objects from the reference repository at clone time but copy them over instead of using the reference as an alternate. This is more straightforward to use than plain --reference, at the cost of higher disk usage. Introduce a --dissociate to "repo init" that brings the same benefits to repo. The option is simply passed on to "git clone". Change-Id: Ib50a549eb71e0a2b3e234aea57537923962a80d4
* | Add support for long pathsRenaud Paquay2018-10-227-42/+138
|/ | | | | | | | | | | | | | | | | | | | * 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
* Merge "update markdown/help header format"Jonathan Nieder2018-10-109-65/+27
|\
| * update markdown/help header formatMike Frysinger2018-10-109-65/+27
| | | | | | | | | | | | | | Since gitiles recommends using # headers over ---/=== underlines, change the manifest-format.md over and all our help texts. Change-Id: I96391d41fba769e9f26870d497cf7cf01c8d8ab3
* | update homepage URIsMike Frysinger2018-10-102-3/+3
|/ | | | Change-Id: I482a72bf296978625b1e82ef580b0e0d4d57ff25
* manifest-format: convert to markdownMike Frysinger2018-10-054-101/+105
| | | | | | | The gitiles system doesn't render .txt files, so convert this to .md for better display online. Change-Id: Ie12e46daf008dd8c97ae2ffd21fb68bd948fe625
* Windows: Add support for creating symlinks as an unprivileged userRenaud Paquay2018-10-031-7/+15
| | | | | | | | | | See https://blogs.windows.com/buildingapps/2016/12/02/symlinks-windows-10/ for announcement of new flag. This change follow the same pattern as what was done in "go": https://github.com/golang/go/pull/24307/files#diff-b87bc12e4da2497308f9ef746086e4f0 Change-Id: If1e99fefdd3f787598e695731019c34b9bfcd1c2
* fix some sync error while using python3Dylan Deng2018-07-243-3/+12
| | | | Change-Id: I70925e48756c356d48359679d8ad1b9e33a68595
* Remove unused pylint suppressionsDavid Pursehouse2018-07-249-25/+6
| | | | | | | | | | | pylint is not used since bb5b1a0. The pyflakes cleanup mentioned in that commit has not been done, but given that this project is no longer being actively developed I don't think it's worth spending time doing it. Leaving the pylint suppressions causes confusion because it leads people to think that we are still using pylint. Change-Id: If7d9f280a0f408c780f15915ffdb80579ae21f69
* Merge "Flush stderr on Windows"Sebastian Schuberth2018-07-131-0/+4
|\