mercurial/commands.py
changeset 21078 50107a4b32e7
parent 21064 4d9d490d7bbe
child 21105 12312f066d93
equal deleted inserted replaced
21077:78b15ad2f968 21078:50107a4b32e7
  1160 
  1160 
  1161     Print the specified files as they were at the given revision. If
  1161     Print the specified files as they were at the given revision. If
  1162     no revision is given, the parent of the working directory is used.
  1162     no revision is given, the parent of the working directory is used.
  1163 
  1163 
  1164     Output may be to a file, in which case the name of the file is
  1164     Output may be to a file, in which case the name of the file is
  1165     given using a format string. The formatting rules are the same as
  1165     given using a format string. The formatting rules as follows:
  1166     for the export command, with the following additions:
  1166 
  1167 
  1167     :``%%``: literal "%" character
  1168     :``%s``: basename of file being printed
  1168     :``%s``: basename of file being printed
  1169     :``%d``: dirname of file being printed, or '.' if in repository root
  1169     :``%d``: dirname of file being printed, or '.' if in repository root
  1170     :``%p``: root-relative path name of file being printed
  1170     :``%p``: root-relative path name of file being printed
       
  1171     :``%H``: changeset hash (40 hexadecimal digits)
       
  1172     :``%R``: changeset revision number
       
  1173     :``%h``: short-form changeset hash (12 hexadecimal digits)
       
  1174     :``%r``: zero-padded changeset revision number
       
  1175     :``%b``: basename of the exporting repository
  1171 
  1176 
  1172     Returns 0 on success.
  1177     Returns 0 on success.
  1173     """
  1178     """
  1174     ctx = scmutil.revsingle(repo, opts.get('rev'))
  1179     ctx = scmutil.revsingle(repo, opts.get('rev'))
  1175     m = scmutil.match(ctx, (file1,) + pats, opts)
  1180     m = scmutil.match(ctx, (file1,) + pats, opts)