Show More
@@ -119,10 +119,10 b' def makepatch(ui, repo, patchlines, opts' | |||||
119 | if patchtags: |
|
119 | if patchtags: | |
120 | patchname = patchtags[0] |
|
120 | patchname = patchtags[0] | |
121 | elif total > 1: |
|
121 | elif total > 1: | |
122 |
patchname = cmdutil.make |
|
122 | patchname = cmdutil.makefilename(repo, '%b-%n.patch', | |
123 | binnode, seqno=idx, total=total) |
|
123 | binnode, seqno=idx, total=total) | |
124 | else: |
|
124 | else: | |
125 |
patchname = cmdutil.make |
|
125 | patchname = cmdutil.makefilename(repo, '%b.patch', binnode) | |
126 | disposition = 'inline' |
|
126 | disposition = 'inline' | |
127 | if opts.get('attach'): |
|
127 | if opts.get('attach'): | |
128 | disposition = 'attachment' |
|
128 | disposition = 'attachment' |
@@ -189,7 +189,7 b' def revrange(repo, revs):' | |||||
189 |
|
189 | |||
190 | return l |
|
190 | return l | |
191 |
|
191 | |||
192 |
def make |
|
192 | def makefilename(repo, pat, node, | |
193 | total=None, seqno=None, revwidth=None, pathname=None): |
|
193 | total=None, seqno=None, revwidth=None, pathname=None): | |
194 | node_expander = { |
|
194 | node_expander = { | |
195 | 'H': lambda: hex(node), |
|
195 | 'H': lambda: hex(node), | |
@@ -246,7 +246,7 b' def make_file(repo, pat, node=None,' | |||||
246 | return pat |
|
246 | return pat | |
247 | if hasattr(pat, 'read') and 'r' in mode: |
|
247 | if hasattr(pat, 'read') and 'r' in mode: | |
248 | return pat |
|
248 | return pat | |
249 |
return open(make |
|
249 | return open(makefilename(repo, pat, node, total, seqno, revwidth, | |
250 | pathname), |
|
250 | pathname), | |
251 | mode) |
|
251 | mode) | |
252 |
|
252 |
@@ -187,7 +187,7 b' def archive(ui, repo, dest, **opts):' | |||||
187 | if not ctx: |
|
187 | if not ctx: | |
188 | raise util.Abort(_('no working directory: please specify a revision')) |
|
188 | raise util.Abort(_('no working directory: please specify a revision')) | |
189 | node = ctx.node() |
|
189 | node = ctx.node() | |
190 |
dest = cmdutil.make |
|
190 | dest = cmdutil.makefilename(repo, dest, node) | |
191 | if os.path.realpath(dest) == repo.root: |
|
191 | if os.path.realpath(dest) == repo.root: | |
192 | raise util.Abort(_('repository root cannot be destination')) |
|
192 | raise util.Abort(_('repository root cannot be destination')) | |
193 |
|
193 | |||
@@ -201,7 +201,7 b' def archive(ui, repo, dest, **opts):' | |||||
201 | if not prefix: |
|
201 | if not prefix: | |
202 | prefix = os.path.basename(repo.root) + '-%h' |
|
202 | prefix = os.path.basename(repo.root) + '-%h' | |
203 |
|
203 | |||
204 |
prefix = cmdutil.make |
|
204 | prefix = cmdutil.makefilename(repo, prefix, node) | |
205 | matchfn = cmdutil.match(repo, [], opts) |
|
205 | matchfn = cmdutil.match(repo, [], opts) | |
206 | archival.archive(repo, dest, node, kind, not opts.get('no_decode'), |
|
206 | archival.archive(repo, dest, node, kind, not opts.get('no_decode'), | |
207 | matchfn, prefix, subrepos=opts.get('subrepos')) |
|
207 | matchfn, prefix, subrepos=opts.get('subrepos')) |
General Comments 0
You need to be logged in to leave comments.
Login now