summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFredrik de Groot <fredrik.de.groot@volvocars.com>2019-11-22 09:04:31 +0100
committerMike Frysinger <vapier@google.com>2020-02-05 18:57:58 +0000
commitcc960971f450907b44259154821515224d3a2ea3 (patch)
tree04900a5ab865a8819f1bad821bb655147dd26e00
parent66098f707a1a3f352aac4c4bb2c4f88da070ca2a (diff)
downloadgit-repo-cc960971f450907b44259154821515224d3a2ea3.tar.gz
sync: add option to skip manifest update
The use case is any situation where your manifest does not exist on server, but where you still want to do full sync for the projects, without having your workspace manifest switched to other branch or forwarded to latest or similar. This allows syncing to a historical manifest in git log, that does not have a branch, as well as when integrating something together that has not been pushed upstream yet. Changes can also exist locally on a manifest that is behind head, meaning not requiring rebase to latest. Tested using: $ cd .repo/manifests/ $ git checkout <any hash 1> $ <do local modifications> $ repo sync --no-manifest-update $ git checkout <any hash 2> $ repo sync --no-manifest-update Change-Id: I0c9773aa8bc5876813a2e7d7fec697abcb2d9e94 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/246445 Tested-by: Fredrik de Groot <fredrik.de.groot@volvocars.com> Reviewed-by: Mike Frysinger <vapier@google.com>
-rw-r--r--subcmds/sync.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/subcmds/sync.py b/subcmds/sync.py
index 2973a16e..ca4b97b3 100644
--- a/subcmds/sync.py
+++ b/subcmds/sync.py
@@ -217,6 +217,10 @@ later is required to fix a server side protocol bug.
217 p.add_option('-l', '--local-only', 217 p.add_option('-l', '--local-only',
218 dest='local_only', action='store_true', 218 dest='local_only', action='store_true',
219 help="only update working tree, don't fetch") 219 help="only update working tree, don't fetch")
220 p.add_option('--no-manifest-update','--nmu',
221 dest='mp_update', action='store_false', default='true',
222 help='use the existing manifest checkout as-is. '
223 '(do not update to the latest revision)')
220 p.add_option('-n', '--network-only', 224 p.add_option('-n', '--network-only',
221 dest='network_only', action='store_true', 225 dest='network_only', action='store_true',
222 help="fetch only, don't update working tree") 226 help="fetch only, don't update working tree")
@@ -907,7 +911,10 @@ later is required to fix a server side protocol bug.
907 if opt.repo_upgraded: 911 if opt.repo_upgraded:
908 _PostRepoUpgrade(self.manifest, quiet=opt.quiet) 912 _PostRepoUpgrade(self.manifest, quiet=opt.quiet)
909 913
910 self._UpdateManifestProject(opt, mp, manifest_name) 914 if not opt.mp_update:
915 print('Skipping update of local manifest project.')
916 else:
917 self._UpdateManifestProject(opt, mp, manifest_name)
911 918
912 if self.gitc_manifest: 919 if self.gitc_manifest:
913 gitc_manifest_projects = self.GetProjects(args, 920 gitc_manifest_projects = self.GetProjects(args,