summaryrefslogtreecommitdiffstats
path: root/subcmds/sync.py
Commit message (Collapse)AuthorAgeFilesLines
...
* sync: Run `git gc --auto` after fetchShawn O. Pearce2011-01-091-0/+2
| | | | | | | | | | | | | Users may wind up with a lot of loose object content in projects they don't frequently make changes in, but that are modified by others. Since we bypass many git code paths that would have otherwise called out to `git gc --auto`, its possible for these projects to have their loose object database grow out of control. To help prevent that, we now invoke it ourselves during the network half of sync. Signed-off-by: Shawn O. Pearce <sop@google.com> (cherry picked from commit 1875ddd47c0bf38e5cc52e1e5875caabce2d8742)
* Encode the environment variables passed to gitShawn O. Pearce2011-01-091-4/+4
| | | | | | | | Windows allows the environment to have unicode values. This will cause Python to fail to execute the command. Change-Id: I37d922c3d7ced0d5b4883f0220346ac42defc5e9 Signed-off-by: Shawn O. Pearce <sop@google.com>
* Added feature to print a <notice> from manifest at the end of a sync.v1.7.1Doug Anderson2010-11-011-0/+5
| | | | | | | | | | | | | | | | | | | | | | | This feature is used to convey information on a when a branch has ceased development or if it is an experimental branch with a few gotchas, etc. You add it to your manifest XML by doing something like this: <manifest> <notice> NOTE TO DEVELOPERS: If you checkin code, you have to pinky-swear that it contains no bugs. Anyone who breaks their promise will have tomatoes thrown at them in the team meeting. Be sure to bring an extra set of clothes. </notice> <remote ... /> ... </manifest> Carriage returns and indentation are relevant for the text in this tag. This feature was requested by Anush Elangovan on the ChromiumOS team.
* sync: Use --force-broken to continue other projectsv1.7Andrei Warkentin2010-10-291-3/+15
| | | | | | | | | | This adds a new flag -f/--force-broken that will allow the rest of the sync process to continue instead of bailing when a particular project fails to sync. Change-Id: I23680f2ee7927410f7ed930b1d469424c9aa246e Signed-off-by: Andrei Warkentin <andreiw@motorola.com> Signed-off-by: Shawn O. Pearce <sop@google.com>
* sync --quiet: be more quietShawn O. Pearce2010-10-291-8/+16
| | | | | Change-Id: I5e8363c7b32e4546d1236cfc5a32e01c3e5ea8e6 Signed-off-by: Shawn O. Pearce <sop@google.com>
* sync: support --jobs to fetch projects simultaneouslyRoy Lee2010-05-271-7/+46
| | | | | | | | | | | | | | This patch does two things for being compatibile with those Python which are built without threading support: 1. As the Python document and Shawn suggested, import dummy_threading when the threading is not available. 2. Reserve the single threaded code and make it default. In cases the --jobs does not work properly with dummy_threading, we still have a safe fallback. Change-Id: I40909ef8e9b5c22f315c0a1da9be38eed8b0a2dc
* Aliasing sync -s to 'smartsync'v1.6.9.7Nico Sallembien2010-05-171-4/+5
| | | | | | | This alias will let people use this command without having to remember the option. Change-Id: I3256d9e8e884c5be9e77f70e9cfb73e0f0c544c6
* Override manifest file only after it is fully written to disk.v1.6.9.4Nico Sallembien2010-04-261-1/+1
| | | | | | We called "Override()" before closing the file passed in argument. Change-Id: I15adb99deb14297ef72fcb1b0945eb246f172fb0
* Strip refs/heads in the branch sent to the manifest server.Nico Sallembien2010-04-261-0/+3
| | | | | | | The manifest server doesn't want to have refs/heads passed to it, so we need to strip that when the branch contains it. Change-Id: I044f8a9629220e886fd5e02e3c1ac4b4bb6020ba
* sync: Safely skip already deleted projectsv1.6.9.3Anthony2010-04-141-25/+29
| | | | | | | Do not error if a project is missing on the filesystem, is deleted from manifest.xml, but still exists in project.list. Change-Id: I1d13e435473c83091e27e4df571504ef493282dd
* Add a 'smart sync' option to repo syncv1.6.9.2Nico Sallembien2010-04-131-0/+52
| | | | | | | | | | | | | This option allows the user to specify a manifest server to use when syncing. This manifest server will provide a manifest pegging each project to a known green build. This allows developers to work on a known good tree that is known to build and pass tests, preventing failed builds to hamper productivity. The manifest used is not "sticky" so as to allow subsequent 'repo sync' calls to sync to the tip of the tree. Change-Id: Id0a24ece20f5a88034ad364b416a1dd2e394226d
* Fixing project renaming bug.v1.6.8.8Nico Sallembien2009-12-101-9/+9
| | | | | | | | This bug happens when a project gets added to the manifest, and then is renamed. Users who happened to have run "repo sync" after the project was added but before the rename happened will try to read the data from the old project, as the manifest was only updated after all projects were updated successfully.
* sync: Keep the project.list file sortedShawn O. Pearce2009-06-041-0/+1
| | | | | | Its easier to locate an entry visually if the file is sorted. Signed-off-by: Shawn O. Pearce <sop@google.com>
* sync: Tolerate blank lines in project.listv1.6.8.1Shawn O. Pearce2009-06-041-1/+5
| | | | | | | | If a line is blank in project.list, its not a relevant project path, so skip over it. Existing project.list files may have blank lines if sync was run with no projects at all, and the file was created empty. Signed-off-by: Shawn O. Pearce <sop@google.com>
* sync: Don't process project.list in a mirrorShawn O. Pearce2009-06-041-0/+4
| | | | | | | | | We have no working tree, so we cannot update the project.list state file, nor should we try to delete a directory if a project is removed from the manifest. Clients would still need the repository for historical records. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Delete empty parent subdirs after deleting obsolete paths.v1.6.8Jaikumar Ganesh2009-06-021-0/+8
| | | | | | After sync, we delete obsolete project paths. Iterate and delete parent subdirs which are empty. Tested on projects within subdirectories.
* Update project paths after sync.Jaikumar Ganesh2009-06-021-0/+48
| | | | | | After a repo sync, some of the project paths might need to be removed. This changes maintains a list of project paths from the previous sync operation and compares.
* Change project.revision to revisionExpr and revisionIdShawn O. Pearce2009-05-291-5/+2
| | | | | | | | | The revisionExpr field now holds an expression from the manifest, such as "refs/heads/master", while revisionId holds the current commit-ish SHA-1 of the revisionExpr. Currently that is only filled in if the manifest points directly to a SHA-1. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Document the SSH ControlMaster behavior of repo syncShawn O. Pearce2009-04-211-0/+29
| | | | Signed-off-by: Shawn O. Pearce <sop@google.com>
* Clarify options that control the repo executable versionShawn O. Pearce2009-04-181-2/+3
| | | | Signed-off-by: Shawn O. Pearce <sop@google.com>
* Only fetch repo once-per-day under normal 'repo sync' usageShawn O. Pearce2009-04-181-3/+11
| | | | | | | | | | | Its unlikely that a new version of repo will be delivered in any given day, so we now check only once every 24 hours to see if repo has been updated. This reduces the sync cost, as we no longer need to contact the repo distribution servers every time we do a sync. repo selfupdate can still be used to force a check. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Change repo sync to be more friendly when updating the treev1.6.6Shawn O. Pearce2009-04-161-5/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | We now try to sync all projects that can be done safely first, before we start rebasing user commits over the upstream. This has the nice effect of making the local tree as close to the upstream as possible before the user has to start resolving merge conflicts, as that extra information in other projects may aid in the conflict resolution. Informational output is buffered and delayed until calculation for all projects has been done, so that the user gets one concise list of notice messages, rather than it interrupting the progress meter. Fast-forward output is now prefixed with the project header, so the user can see which project that update is taking place in, and make some relation of the diffstat back to the project name. Rebase output is now prefixed with the project header, so that if the rebase fails, the user can see which project we were operating on and can try to address the failure themselves. Since rebase sits on a detached HEAD, we now look for an in-progress rebase during sync, so we can alert the user that the given project is in a state we cannot handle. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Add 'repo selfupdate' to upgrade only repoShawn O. Pearce2009-04-131-15/+24
| | | | | | | Users may want to upgrade only repo to the latest release, but leave their working tree state alone and avoid 'repo sync'. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Add a project progress meter to 'repo sync'Shawn O. Pearce2009-04-101-1/+8
| | | | | | | | This way users can see how much is left during fetch. Its especially useful when most syncs are no-ops but there are hundreds of repositories to poll. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Add 'repo sync -l' to only do local operationsShawn O. Pearce2009-04-101-25/+33
| | | | | | | | | | | | | This permits usage of 'repo sync' while offline, as we bypass the network based portions of the code and do only the local sync. An example use case might be: repo sync -n ; # while we have network ... some time later ... repo sync -l ; # while without network, come up to date Signed-off-by: Shawn O. Pearce <sop@google.com>
* Add 'repo sync -d' to detach projects from their current topicShawn O. Pearce2009-04-101-1/+15
| | | | | | | | | | The -d flag moves the project back to a detached HEAD state, matching what is listed in the manifest. This can be useful to set a client to something stable (or at least well-known), such as before a sequence of 'repo download' commands are used to get some changes for testing. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Add 'repo sync -n' to only do the network transferShawn O. Pearce2009-04-101-0/+7
| | | | | | | | This makes it easier to update all repositories, without actually impacting the working directory, or learning about how to use `repo forall -c 'git fetch $REPO_REMOTE' `. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Hide the internal sync --repo-upgraded flag from usersShawn O. Pearce2009-04-101-1/+2
| | | | | | | | This is only meant to be passed through while repo upgrades itself during a sync. It should never be something a user invokes on their own. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Don't permit users to run repo status in a mirror clientShawn O. Pearce2009-03-031-2/+2
| | | | | | | | | | | | | | | | If a client was created with "repo init --mirror" then there are no working directories present, and no files checked out. Using a command like "repo status" in this context makes no sense, and actually throws back a Pytyon traceback at the console when the underlying commands fail out. We now tag commands with the MirrorSafeCommand type if they are able to be executed within a mirror directory safely. Using a command in a mirror which lacks this base class results in a useful error letting you know the command isn't supported. Bug: REPO-14 Signed-off-by: Shawn O. Pearce <sop@google.com>
* Add 'repo init --mirror' to download a complete forrestv1.1Shawn O. Pearce2008-11-051-2/+3
| | | | | | | | | | | | | | | The mirror option downloads a complete forrest (as described by the manifest) and creates a replica of the remote repositories rather than a client working directory. This permits other clients to sync off the mirror site. A mirror can be positioned in a "DMZ", where the mirror executes "repo sync" to obtain changes from the external upstream and clients inside the protected zone operate off the mirror only, and therefore do not require direct git:// access to the external upstream repositories. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Install a default pre-auto-gc hook in all repositoriesShawn O. Pearce2008-11-031-1/+9
| | | | | | | | | | | | | | | | | | | | This hook is evaluated by `git gc --auto` to determine if it is a good idea to execute a GC at this time, or defer it to some later date. When working on a laptop its a good idea to avoid GC if you are on battery power as the extra CPU and disk IO would consume a decent amount of the charge. The hook is the standard sample hook from git.git contrib/hooks, last modified in git.git by 84ed4c5d117d72f02cc918e413b9861a9d2846d7. I added the GPLv2 header to the script to ensure the license notice is clear, as it does not match repo's own APLv2 license. We only update hooks during initial repository creation or on a repo sync. This way we don't incur huge overheads from the hook stat operations during "repo status" or even the normal "repo sync" cases. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Initial Contributionv1.0The Android Open Source Project2008-10-211-0/+150