mercurial/cmdutil.py
changeset 14290 86e70956da4f
parent 14289 d68ddccf276b
child 14291 1a791993ce59
equal deleted inserted replaced
14289:d68ddccf276b 14290:86e70956da4f
   187                 l.append(r)
   187                 l.append(r)
   188         seen.update(l)
   188         seen.update(l)
   189 
   189 
   190     return l
   190     return l
   191 
   191 
   192 def make_filename(repo, pat, node,
   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),
   196         'R': lambda: str(repo.changelog.rev(node)),
   196         'R': lambda: str(repo.changelog.rev(node)),
   197         'h': lambda: short(node),
   197         'h': lambda: short(node),
   244         return os.fdopen(os.dup(fp.fileno()), mode)
   244         return os.fdopen(os.dup(fp.fileno()), mode)
   245     if hasattr(pat, 'write') and writable:
   245     if hasattr(pat, 'write') and writable:
   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_filename(repo, pat, node, total, seqno, revwidth,
   249     return open(makefilename(repo, pat, node, total, seqno, revwidth,
   250                               pathname),
   250                               pathname),
   251                 mode)
   251                 mode)
   252 
   252 
   253 def copy(ui, repo, pats, opts, rename=False):
   253 def copy(ui, repo, pats, opts, rename=False):
   254     # called with the repo lock held
   254     # called with the repo lock held