comparison mercurial/patch.py @ 7319:eae1767cc6a8

export: fixed silent output file overwriting hg export -o outfile 1 2 3 4 had the same effect as hg -o outfile 4 This was caused by opening with 'w' instead of 'a'. This only occurs when the filename pattern resulted in ambiguous patch filenames.
author Ronny Pfannschmidt <Ronny.Pfannschmidt@gmx.de>
date Thu, 06 Nov 2008 11:17:38 +0100
parents b6f5490effbf
children 72f0e4ebd9e6
comparison
equal deleted inserted replaced
7318:95e1260b8134 7319:eae1767cc6a8
1292 parents.reverse() 1292 parents.reverse()
1293 prev = (parents and parents[0]) or nullid 1293 prev = (parents and parents[0]) or nullid
1294 1294
1295 if not fp: 1295 if not fp:
1296 fp = cmdutil.make_file(repo, template, node, total=total, 1296 fp = cmdutil.make_file(repo, template, node, total=total,
1297 seqno=seqno, revwidth=revwidth) 1297 seqno=seqno, revwidth=revwidth,
1298 mode='ab')
1298 if fp != sys.stdout and hasattr(fp, 'name'): 1299 if fp != sys.stdout and hasattr(fp, 'name'):
1299 repo.ui.note("%s\n" % fp.name) 1300 repo.ui.note("%s\n" % fp.name)
1300 1301
1301 fp.write("# HG changeset patch\n") 1302 fp.write("# HG changeset patch\n")
1302 fp.write("# User %s\n" % ctx.user()) 1303 fp.write("# User %s\n" % ctx.user())