diff --git a/hgext/patchbomb.py b/hgext/patchbomb.py --- a/hgext/patchbomb.py +++ b/hgext/patchbomb.py @@ -119,10 +119,10 @@ def makepatch(ui, repo, patchlines, opts if patchtags: patchname = patchtags[0] elif total > 1: - patchname = cmdutil.make_filename(repo, '%b-%n.patch', + patchname = cmdutil.makefilename(repo, '%b-%n.patch', binnode, seqno=idx, total=total) else: - patchname = cmdutil.make_filename(repo, '%b.patch', binnode) + patchname = cmdutil.makefilename(repo, '%b.patch', binnode) disposition = 'inline' if opts.get('attach'): disposition = 'attachment' diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -189,7 +189,7 @@ def revrange(repo, revs): return l -def make_filename(repo, pat, node, +def makefilename(repo, pat, node, total=None, seqno=None, revwidth=None, pathname=None): node_expander = { 'H': lambda: hex(node), @@ -246,7 +246,7 @@ def make_file(repo, pat, node=None, return pat if hasattr(pat, 'read') and 'r' in mode: return pat - return open(make_filename(repo, pat, node, total, seqno, revwidth, + return open(makefilename(repo, pat, node, total, seqno, revwidth, pathname), mode) diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -187,7 +187,7 @@ def archive(ui, repo, dest, **opts): if not ctx: raise util.Abort(_('no working directory: please specify a revision')) node = ctx.node() - dest = cmdutil.make_filename(repo, dest, node) + dest = cmdutil.makefilename(repo, dest, node) if os.path.realpath(dest) == repo.root: raise util.Abort(_('repository root cannot be destination')) @@ -201,7 +201,7 @@ def archive(ui, repo, dest, **opts): if not prefix: prefix = os.path.basename(repo.root) + '-%h' - prefix = cmdutil.make_filename(repo, prefix, node) + prefix = cmdutil.makefilename(repo, prefix, node) matchfn = cmdutil.match(repo, [], opts) archival.archive(repo, dest, node, kind, not opts.get('no_decode'), matchfn, prefix, subrepos=opts.get('subrepos'))