remote-hg: only update necessary revisions
We don't care about the rest, and in fact, we shouldn't try to push everything, as there might be garbage from previous failed pushes. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
		 Felipe Contreras
					Felipe Contreras
				
			
				
					committed by
					
						 Junio C Hamano
						Junio C Hamano
					
				
			
			
				
	
			
			
			 Junio C Hamano
						Junio C Hamano
					
				
			
						parent
						
							dfcef29f2f
						
					
				
				
					commit
					d226945471
				
			| @ -858,6 +858,7 @@ def do_export(parser): | |||||||
|     global parsed_refs, bmarks, peer |     global parsed_refs, bmarks, peer | ||||||
|  |  | ||||||
|     p_bmarks = [] |     p_bmarks = [] | ||||||
|  |     p_revs = set() | ||||||
|  |  | ||||||
|     parser.next() |     parser.next() | ||||||
|  |  | ||||||
| @ -882,6 +883,7 @@ def do_export(parser): | |||||||
|             if branch in branches and bnode in branches[branch]: |             if branch in branches and bnode in branches[branch]: | ||||||
|                 # up to date |                 # up to date | ||||||
|                 continue |                 continue | ||||||
|  |             p_revs.add(bnode) | ||||||
|             print "ok %s" % ref |             print "ok %s" % ref | ||||||
|         elif ref.startswith('refs/heads/'): |         elif ref.startswith('refs/heads/'): | ||||||
|             bmark = ref[len('refs/heads/'):] |             bmark = ref[len('refs/heads/'):] | ||||||
| @ -896,6 +898,7 @@ def do_export(parser): | |||||||
|                     not (bmark == 'master' and bmark not in parser.repo._bookmarks): |                     not (bmark == 'master' and bmark not in parser.repo._bookmarks): | ||||||
|                 p_bmarks.append((ref, bmark, old, new)) |                 p_bmarks.append((ref, bmark, old, new)) | ||||||
|  |  | ||||||
|  |             p_revs.add(bnode) | ||||||
|         elif ref.startswith('refs/tags/'): |         elif ref.startswith('refs/tags/'): | ||||||
|             tag = ref[len('refs/tags/'):] |             tag = ref[len('refs/tags/'):] | ||||||
|             tag = hgref(tag) |             tag = hgref(tag) | ||||||
| @ -903,18 +906,20 @@ def do_export(parser): | |||||||
|             if mode == 'git': |             if mode == 'git': | ||||||
|                 if not msg: |                 if not msg: | ||||||
|                     msg = 'Added tag %s for changeset %s' % (tag, node[:12]); |                     msg = 'Added tag %s for changeset %s' % (tag, node[:12]); | ||||||
|                 write_tag(parser.repo, tag, node, msg, author) |                 tagnode = write_tag(parser.repo, tag, node, msg, author) | ||||||
|  |                 p_revs.add(tagnode) | ||||||
|             else: |             else: | ||||||
|                 fp = parser.repo.opener('localtags', 'a') |                 fp = parser.repo.opener('localtags', 'a') | ||||||
|                 fp.write('%s %s\n' % (node, tag)) |                 fp.write('%s %s\n' % (node, tag)) | ||||||
|                 fp.close() |                 fp.close() | ||||||
|  |             p_revs.add(bnode) | ||||||
|             print "ok %s" % ref |             print "ok %s" % ref | ||||||
|         else: |         else: | ||||||
|             # transport-helper/fast-export bugs |             # transport-helper/fast-export bugs | ||||||
|             continue |             continue | ||||||
|  |  | ||||||
|     if peer: |     if peer: | ||||||
|         parser.repo.push(peer, force=force_push, newbranch=True) |         parser.repo.push(peer, force=force_push, newbranch=True, revs=list(p_revs)) | ||||||
|  |  | ||||||
|         # update remote bookmarks |         # update remote bookmarks | ||||||
|         remote_bmarks = peer.listkeys('bookmarks') |         remote_bmarks = peer.listkeys('bookmarks') | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user