# HG changeset patch # User Phil Cohen # Date 1499816895 25200 # Node ID d1aa3fee4ca401ac647b14dac7a255f9a6572bf9 # Parent e80041832eec342d50fa1e2affa0c3fd3bc255f7 tagmerge: use workingfilectx to write merged tags This function already does an excellent job of reading from context objects; we simply need to change the single write call to eliminate all uses of the wvfs. As with past changes, the effect should be a no-op but opens the door to in-memory merge later by using different context objects. diff -r e80041832eec -r d1aa3fee4ca4 mercurial/tagmerge.py --- a/mercurial/tagmerge.py Thu Jun 29 20:45:12 2017 +0900 +++ b/mercurial/tagmerge.py Tue Jul 11 16:48:15 2017 -0700 @@ -136,7 +136,7 @@ prevlinenum = linenum return groupednodes -def writemergedtags(repo, mergedtags): +def writemergedtags(fcd, mergedtags): ''' write the merged tags while trying to minimize the diff to the first parent @@ -169,9 +169,7 @@ # finally we can join the sorted groups to get the final contents of the # merged .hgtags file, and then write it to disk mergedtagstring = '\n'.join([tags for rank, tags in finaltags if tags]) - fp = repo.wvfs('.hgtags', 'wb') - fp.write(mergedtagstring + '\n') - fp.close() + fcd.write(mergedtagstring + '\n', fcd.flags()) def singletagmerge(p1nodes, p2nodes): ''' @@ -268,7 +266,7 @@ % (numconflicts, ', '.join(sorted(conflictedtags)))) return True, 1 - writemergedtags(repo, mergedtags) + writemergedtags(fcd, mergedtags) ui.note(_('.hgtags merged successfully\n')) return False, 0