|  | @@ -12,9 +12,9 @@ COM=sys.argv[0]
 | 
											
												
													
														|  |  def parser():
 |  |  def parser():
 | 
											
												
													
														|  |      from argparse import ArgumentParser
 |  |      from argparse import ArgumentParser
 | 
											
												
													
														|  |      p = ArgumentParser()
 |  |      p = ArgumentParser()
 | 
											
												
													
														|  | -    p.add_argument("source")
 |  | 
 | 
											
												
													
														|  | -    p.add_argument("-b", "--base", default="./repositories",help="local basedir for mirror")
 |  | 
 | 
											
												
													
														|  | -    p.add_argument("-t", "--threads", default=4, type=int,help="number of worker threads")
 |  | 
 | 
											
												
													
														|  | 
 |  | +    p.add_argument("source", help="git origin that will be used to fetch repos. Should support 'ssh <source> info'")
 | 
											
												
													
														|  | 
 |  | +    p.add_argument("-b", "--base", default="./repositories", help="local basedir for mirror")
 | 
											
												
													
														|  | 
 |  | +    p.add_argument("-t", "--threads", default=4, type=int, help="number of worker threads")
 | 
											
												
													
														|  |      return p
 |  |      return p
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  def main():
 |  |  def main():
 | 
											
										
											
												
													
														|  | @@ -62,12 +62,12 @@ class Repo():
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |              self.init()
 |  |              self.init()
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -        self.update_local()
 |  | 
 | 
											
												
													
														|  | 
 |  | +        self.fetch()
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |          return True
 |  |          return True
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -    def update_local(self):
 |  | 
 | 
											
												
													
														|  | -        proc = run(["git","fetch","-p","origin"], cwd=self.local_path)
 |  | 
 | 
											
												
													
														|  | 
 |  | +    def fetch(self):
 | 
											
												
													
														|  | 
 |  | +        proc = run(["git","fetch","-p","origin","refs/*:refs/*"], cwd=self.local_path)
 | 
											
												
													
														|  |          if not proc.returncode == 0:
 |  |          if not proc.returncode == 0:
 | 
											
												
													
														|  |              print(f"Error: {proc}, {local_repo}")
 |  |              print(f"Error: {proc}, {local_repo}")
 | 
											
												
													
														|  |              _rm(self.local_path)
 |  |              _rm(self.local_path)
 | 
											
										
											
												
													
														|  | @@ -144,6 +144,8 @@ def map_threaded(target, args=[], threads=4, debug=None):
 | 
											
												
													
														|  |      while fillThread.is_alive():
 |  |      while fillThread.is_alive():
 | 
											
												
													
														|  |          yield outq.get(block=True)
 |  |          yield outq.get(block=True)
 | 
											
												
													
														|  |      fillThread.join()
 |  |      fillThread.join()
 | 
											
												
													
														|  | 
 |  | +    while not outq.empty():
 | 
											
												
													
														|  | 
 |  | +        yield outq.get(block=True)
 | 
											
												
													
														|  |      for job in jobs:
 |  |      for job in jobs:
 | 
											
												
													
														|  |          job.join()
 |  |          job.join()
 | 
											
												
													
														|  |      while not outq.empty():
 |  |      while not outq.empty():
 |