comparison hgsubversion/svnmeta.py @ 1199:955f7173e498

svnmeta: call makememfilectx
author Sean Farley <sean.michael.farley@gmail.com>
date Mon, 02 Jun 2014 19:09:11 -0500
parents 1414cdafa7af
children 9fc3557ce85e
comparison
equal deleted inserted replaced
1198:b1a6edc78bfb 1199:955f7173e498
5 from mercurial import context 5 from mercurial import context
6 from mercurial import util as hgutil 6 from mercurial import util as hgutil
7 from mercurial import revlog 7 from mercurial import revlog
8 from mercurial import node 8 from mercurial import node
9 9
10 import compathacks
10 import util 11 import util
11 import maps 12 import maps
12 import layouts 13 import layouts
13 import editor 14 import editor
14 15
660 else: 661 else:
661 tagdata = '' 662 tagdata = ''
662 tagdata += '%s %s\n' % (node.hex(hash), self.tagmap.get(tag, tag)) 663 tagdata += '%s %s\n' % (node.hex(hash), self.tagmap.get(tag, tag))
663 def hgtagsfn(repo, memctx, path): 664 def hgtagsfn(repo, memctx, path):
664 assert path == '.hgtags' 665 assert path == '.hgtags'
665 return context.memfilectx(path=path, 666 return compathacks.makememfilectx(repo,
666 data=tagdata, 667 path=path,
667 islink=False, 668 data=tagdata,
668 isexec=False, 669 islink=False,
669 copied=False) 670 isexec=False,
671 copied=False)
670 revnum, branch = self.get_source_rev(ctx=parentctx)[:2] 672 revnum, branch = self.get_source_rev(ctx=parentctx)[:2]
671 newparent = None 673 newparent = None
672 for child in parentctx.children(): 674 for child in parentctx.children():
673 if (self.get_source_rev(ctx=child)[1] == branch 675 if (self.get_source_rev(ctx=child)[1] == branch
674 and child.extra().get('close', False)): 676 and child.extra().get('close', False)):
730 src += '%s %s\n' % (tagged, self.tagmap.get(tag, tag)) 732 src += '%s %s\n' % (tagged, self.tagmap.get(tag, tag))
731 self.tags[tag] = node.bin(tagged), rev.revnum 733 self.tags[tag] = node.bin(tagged), rev.revnum
732 734
733 # add new changeset containing updated .hgtags 735 # add new changeset containing updated .hgtags
734 def fctxfun(repo, memctx, path): 736 def fctxfun(repo, memctx, path):
735 return context.memfilectx(path='.hgtags', data=src, 737 return compathacks.makememfilectx(repo,
736 islink=False, isexec=False, 738 path='.hgtags',
737 copied=None) 739 data=src,
740 islink=False,
741 isexec=False,
742 copied=None)
738 743
739 extra = self.genextra(rev.revnum, b) 744 extra = self.genextra(rev.revnum, b)
740 if fromtag: 745 if fromtag:
741 extra['branch'] = parent.extra().get('branch', 'default') 746 extra['branch'] = parent.extra().get('branch', 'default')
742 self.mapbranch(extra, b in endbranches or fromtag) 747 self.mapbranch(extra, b in endbranches or fromtag)