comparison mercurial/commands.py @ 1589:fce5292866c6

fix a bug in hg export --switch-parent
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
date Fri, 16 Dec 2005 00:12:00 -0600
parents 5c5aaaa9ab6f
children 41366b7d6709
comparison
equal deleted inserted replaced
1588:a679a364436a 1589:fce5292866c6
1117 text=opts['text']) 1117 text=opts['text'])
1118 1118
1119 def doexport(ui, repo, changeset, seqno, total, revwidth, opts): 1119 def doexport(ui, repo, changeset, seqno, total, revwidth, opts):
1120 node = repo.lookup(changeset) 1120 node = repo.lookup(changeset)
1121 parents = [p for p in repo.changelog.parents(node) if p != nullid] 1121 parents = [p for p in repo.changelog.parents(node) if p != nullid]
1122 if opts['switch_parent']:
1123 parents.reverse()
1122 prev = (parents and parents[0]) or nullid 1124 prev = (parents and parents[0]) or nullid
1123 change = repo.changelog.read(node) 1125 change = repo.changelog.read(node)
1124 1126
1125 if opts['switch_parent']:
1126 parents.reverse()
1127 fp = make_file(repo, repo.changelog, opts['output'], 1127 fp = make_file(repo, repo.changelog, opts['output'],
1128 node=node, total=total, seqno=seqno, 1128 node=node, total=total, seqno=seqno,
1129 revwidth=revwidth) 1129 revwidth=revwidth)
1130 if fp != sys.stdout: 1130 if fp != sys.stdout:
1131 ui.note("%s\n" % fp.name) 1131 ui.note("%s\n" % fp.name)