From e284ad1d1a2c6fa0e0ac800e87b2607f9bda339e Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Tue, 4 Nov 2008 07:37:10 -0800 Subject: Add 'repo init --mirror' to download a complete forrest 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 --- git_config.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'git_config.py') diff --git a/git_config.py b/git_config.py index 76031a0e..9d5162e7 100644 --- a/git_config.py +++ b/git_config.py @@ -285,12 +285,14 @@ class Remote(object): return True return False - def ResetFetch(self): + def ResetFetch(self, mirror=False): """Set the fetch refspec to its default value. """ - self.fetch = [RefSpec(True, - 'refs/heads/*', - 'refs/remotes/%s/*' % self.name)] + if mirror: + dst = 'refs/heads/*' + else: + dst = 'refs/remotes/%s/*' % self.name + self.fetch = [RefSpec(True, 'refs/heads/*', dst)] def Save(self): """Save this remote to the configuration. -- cgit v1.2.3-54-g00ecf