summaryrefslogtreecommitdiffstats
path: root/subcmds
diff options
context:
space:
mode:
authorBrian Harring <ferringb@google.com>2012-09-28 20:21:57 -0700
committerBrian Harring <ferringb@google.com>2012-09-28 22:31:27 -0700
commit14a6674e32b3000dbe8b7c96b0d1bb4fb0021720 (patch)
tree024482226fefd4c188f20f56047325b69d388a9f /subcmds
parent34acdd253439448b6c08c3abfc5e7b8bd03f383f (diff)
downloadgit-repo-14a6674e32b3000dbe8b7c96b0d1bb4fb0021720.tar.gz
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
Diffstat (limited to 'subcmds')
-rw-r--r--subcmds/manifest.py8
1 files changed, 7 insertions, 1 deletions
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.
48 p.add_option('-r', '--revision-as-HEAD', 48 p.add_option('-r', '--revision-as-HEAD',
49 dest='peg_rev', action='store_true', 49 dest='peg_rev', action='store_true',
50 help='Save revisions as current HEAD') 50 help='Save revisions as current HEAD')
51 p.add_option('--suppress-upstream-revision', dest='peg_rev_upstream',
52 default=True, action='store_false',
53 help='If in -r mode, do not write the upstream field. '
54 'Only of use if the branch names for a sha1 manifest are '
55 'sensitive.')
51 p.add_option('-o', '--output-file', 56 p.add_option('-o', '--output-file',
52 dest='output_file', 57 dest='output_file',
53 default='-', 58 default='-',
@@ -60,7 +65,8 @@ in a Git repository for use during future 'repo init' invocations.
60 else: 65 else:
61 fd = open(opt.output_file, 'w') 66 fd = open(opt.output_file, 'w')
62 self.manifest.Save(fd, 67 self.manifest.Save(fd,
63 peg_rev = opt.peg_rev) 68 peg_rev = opt.peg_rev,
69 peg_rev_upstream = opt.peg_rev_upstream)
64 fd.close() 70 fd.close()
65 if opt.output_file != '-': 71 if opt.output_file != '-':
66 print >>sys.stderr, 'Saved manifest to %s' % opt.output_file 72 print >>sys.stderr, 'Saved manifest to %s' % opt.output_file