From 14a6674e32b3000dbe8b7c96b0d1bb4fb0021720 Mon Sep 17 00:00:00 2001 From: Brian Harring Date: Fri, 28 Sep 2012 20:21:57 -0700 Subject: manifest: record the original revision when in -r mode. Currently when doing a sync against a revision locked manifest, sync has no option but to fall back to sync'ing the entire refs space; it doesn't know which ref to ask for that contains the sha1 it wants. This sucks if we're in -c mode; thus when we generate a revision locked manifest, record the originating branch- and try syncing that branch first. If the sha1 is found within that branch, this saves us having to pull down the rest of the repo- a potentially heavy saving. If that branch doesn't have the desired sha1, we fallback to sync'ing everything. Change-Id: I99a5e44fa1d792dfcada76956a2363187df94cf1 --- subcmds/manifest.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'subcmds/manifest.py') diff --git a/subcmds/manifest.py b/subcmds/manifest.py index cd196531..43887654 100644 --- a/subcmds/manifest.py +++ b/subcmds/manifest.py @@ -48,6 +48,11 @@ in a Git repository for use during future 'repo init' invocations. p.add_option('-r', '--revision-as-HEAD', dest='peg_rev', action='store_true', help='Save revisions as current HEAD') + p.add_option('--suppress-upstream-revision', dest='peg_rev_upstream', + default=True, action='store_false', + help='If in -r mode, do not write the upstream field. ' + 'Only of use if the branch names for a sha1 manifest are ' + 'sensitive.') p.add_option('-o', '--output-file', dest='output_file', default='-', @@ -60,7 +65,8 @@ in a Git repository for use during future 'repo init' invocations. else: fd = open(opt.output_file, 'w') self.manifest.Save(fd, - peg_rev = opt.peg_rev) + peg_rev = opt.peg_rev, + peg_rev_upstream = opt.peg_rev_upstream) fd.close() if opt.output_file != '-': print >>sys.stderr, 'Saved manifest to %s' % opt.output_file -- cgit v1.2.3-54-g00ecf