Go to file
wenchiching 366824937c platform_utils: os.rename exception when src and des on different file system
Symptom: repo sync exception
Root Cause: os.rename only works when source and destination are on the same file system
Solution: using shutil.move

to save disk usage, I create links for projects and project-objects, link to folder on another disk
lrwxrwxrwx  1 owenwen owenwen   47 Jun  9 16:40 project-objects -> /disk3/AndroidLocalRepos/.repo/project-objects/
lrwxrwxrwx  1 owenwen owenwen   40 Jun  9 16:40 projects -> /disk3/AndroidLocalRepos/.repo/projects/

below are exception I met:
"""
Traceback (most recent call last):
  File "/usr/lib/python3.6/multiprocessing/pool.py", line 119, in worker
    result = (True, func(*args, **kwds))
  File "/usr/lib/python3.6/multiprocessing/pool.py", line 44, in mapstar
    return list(map(*args))
  File "/disk2/Android11/.repo/repo/subcmds/sync.py", line 550, in _CheckoutOne
    project.Sync_LocalHalf(syncbuf, force_sync=force_sync)
  File "/disk2/Android11/.repo/repo/project.py", line 1251, in Sync_LocalHalf
    self._InitWorkTree(force_sync=force_sync, submodules=submodules)
  File "/disk2/Android11/.repo/repo/project.py", line 2801, in _InitWorkTree
    self._CheckDirReference(self.gitdir, dotgit, share_refs=True)
  File "/disk2/Android11/.repo/repo/project.py", line 2674, in _CheckDirReference
    platform_utils.rename(dst_path, src_path)
  File "/disk2/Android11/.repo/repo/platform_utils.py", line 127, in rename
    os.rename(src, dst)
OSError: [Errno 18] Invalid cross-device link: '/disk2/Android11/system/libhidl/.git/packed-refs' -> '/disk2/Android11/.repo/projects/system/libhidl.git/packed-refs'
"""

Change-Id: Ifda2f16530cc5a8f280169f482ee858f9e5241d3
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/316002
Tested-by: Mike Frysinger <vapier@google.com>
Reviewed-by: Mike Frysinger <vapier@google.com>
2021-09-24 08:20:06 +00:00
.github/workflows Drop support for Python 3.5 2021-06-03 11:34:17 +00:00
docs docs: Add version for Ubuntu 21.04 Hirsute and Debian 11 Bullseye 2021-09-03 00:16:43 +00:00
hooks Revert "commit-msg: Insert Change-Id at start of trailers" 2020-04-15 07:17:16 +00:00
man man: make output system independent 2021-07-31 11:39:35 +00:00
release update-manpages: avoid regen just for datestamp update 2021-09-22 19:37:35 +00:00
subcmds sync: Log repo sync state events as 'data' events. 2021-09-14 21:36:12 +00:00
tests manifest: make repo-hooks more robust wrt element ordering 2021-09-23 21:17:38 +00:00
.flake8 flake8: Suppress "E731 do not assign a lambda expression, use a def" 2020-02-15 03:41:17 +00:00
.gitattributes Adds additional crlf clobber avoidance. 2016-06-22 08:36:45 +00:00
.gitignore Add parallelism to 'branches' command 2020-12-14 23:35:12 +00:00
.mailmap Update .mailmap 2020-02-13 04:49:55 +00:00
.project Set correct name in PyDev and Eclipse project config 2013-04-19 09:35:43 +09:00
.pydevproject Leverage the next keyword from python 2.7 2018-12-19 11:06:35 -08:00
color.py strip python2-only coding:utf-8 & print_function settings 2021-01-06 18:53:05 +00:00
command.py man: make output system independent 2021-07-31 11:39:35 +00:00
completion.bash bash-completion: complete projects with repo forall 2021-07-27 06:20:52 +00:00
editor.py strip python2-only coding:utf-8 & print_function settings 2021-01-06 18:53:05 +00:00
error.py help/version: sprinkle bug report URL around 2021-04-26 21:43:43 +00:00
event_log.py strip python2-only coding:utf-8 & print_function settings 2021-01-06 18:53:05 +00:00
git_command.py Add the ability to administratively enroll repo into using superproject. 2021-07-01 16:27:43 +00:00
git_config.py sync: Remove '_' from the repo.syncstate.* keys when saved to config. 2021-07-29 22:41:57 +00:00
git_refs.py git_refs: fix crash with binary . files in .git/refs/ 2021-02-28 16:07:24 +00:00
git_ssh add license header to a few more files 2019-06-13 13:23:19 -04:00
git_superproject.py superproject: Move enrollment to opt-out when enabled globally 2021-09-20 07:21:22 +00:00
git_trace2_event_log.py sync: Log repo sync state events as 'data' events. 2021-09-14 21:36:12 +00:00
gitc_utils.py superproject: pass groups to ToXml method. 2021-03-11 01:24:52 +00:00
hooks.py drop pyversion & is_python3 checking 2021-01-06 18:53:58 +00:00
LICENSE setup.py: add basic packaging files 2019-12-02 04:23:31 +00:00
main.py repo: add --show-toplevel akin to git 2021-07-28 05:38:53 +00:00
manifest_xml.py manifest: make repo-hooks more robust wrt element ordering 2021-09-23 21:17:38 +00:00
MANIFEST.in setup.py: add basic packaging files 2019-12-02 04:23:31 +00:00
pager.py strip python2-only coding:utf-8 & print_function settings 2021-01-06 18:53:05 +00:00
platform_utils_win32.py drop pyversion & is_python3 checking 2021-01-06 18:53:58 +00:00
platform_utils.py platform_utils: os.rename exception when src and des on different file system 2021-09-24 08:20:06 +00:00
progress.py progress: hide progress bar when --quiet 2021-04-13 22:25:26 +00:00
project.py repo: properly handle remote annotations in manifest_xml 2021-07-23 18:03:11 +00:00
README.md README: use new bug template 2020-02-26 23:20:43 +00:00
repo launcher: bump version for new release 2021-05-10 17:10:04 +00:00
repo_trace.py strip python2-only coding:utf-8 & print_function settings 2021-01-06 18:53:05 +00:00
requirements.json Drop support for Python 3.5 2021-06-03 11:34:17 +00:00
run_tests run_tests: fix pytest selection inside tox venv 2021-06-03 15:27:51 +00:00
setup.py Drop support for Python 3.5 2021-06-03 11:34:17 +00:00
ssh.py ssh: rewrite proxy management for multiprocessing usage 2021-05-10 21:16:06 +00:00
SUBMITTING_PATCHES.md switch to "main" branch for development 2020-11-16 05:07:33 +00:00
tox.ini Drop support for Python 3.5 2021-06-03 11:34:17 +00:00
wrapper.py strip python2-only coding:utf-8 & print_function settings 2021-01-06 18:53:05 +00:00

repo

Repo is a tool built on top of Git. Repo helps manage many Git repositories, does the uploads to revision control systems, and automates parts of the development workflow. Repo is not meant to replace Git, only to make it easier to work with Git. The repo command is an executable Python script that you can put anywhere in your path.

Contact

Please use the repo-discuss mailing list or issue tracker for questions.

You can file a new bug report under the "repo" component.

Please do not e-mail individual developers for support. They do not have the bandwidth for it, and often times questions have already been asked on repo-discuss or bugs posted to the issue tracker. So please search those sites first.

Install

Many distros include repo, so you might be able to install from there.

# Debian/Ubuntu.
$ sudo apt-get install repo

# Gentoo.
$ sudo emerge dev-vcs/repo

You can install it manually as well as it's a single script.

$ mkdir -p ~/.bin
$ PATH="${HOME}/.bin:${PATH}"
$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/.bin/repo
$ chmod a+rx ~/.bin/repo