Bug 3887 - hg log --template "{rev}: {join(file_copies,';')}\n" prints literal "sourcename" for renames
Summary: hg log --template "{rev}: {join(file_copies,';')}\n" prints literal "sourcena...
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: Mercurial (show other bugs)
Version: earlier
Hardware: PC Windows
: normal bug
Assignee: Bugzilla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-15 10:13 UTC by Scott Palmer
Modified: 2017-11-01 18:05 UTC (History)
3 users (show)

See Also:
Python Version: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Scott Palmer 2013-04-15 10:13 UTC
The template {file_copies} should return a "list of strings" according to the docs.  So it should work with join(file_copies,';'), but it does not.

hg log --template "{rev}: {join(file_copies,';')}\n" 

prints literal "sourcename" for a revision with a rename, as in:

1: sourcename
Comment 1 Scott Palmer 2013-04-15 10:18 UTC
Note that:

hg log --template "{rev}: {file_copies}\n" 

prints the renamed file info correctly.
Comment 2 Matt Mackall 2013-04-15 13:35 UTC
Already fixed by:

changeset:   18715:c4ff927b6f68
parent:      18703:5bef0655f2e9
user:        Matt Mackall <mpm@selenic.com>
date:        Fri Feb 22 13:45:46 2013 -0600
summary:     templater: properly handle file_copies with %

Will be in 2.6 on May 1.
Comment 3 Nikolaj Sjujskij 2013-04-16 03:42 UTC
(In reply to comment #2)
> Already fixed by:
> 
> changeset:   18715:c4ff927b6f68
> parent:      18703:5bef0655f2e9
> user:        Matt Mackall <mpm@selenic.com>
> date:        Fri Feb 22 13:45:46 2013 -0600
> summary:     templater: properly handle file_copies with %
> 
> Will be in 2.6 on May 1.

 I doubt that:

 [☿:default] test % hg log --template "{rev}: {file_copies}\n"          
2:                                           
1: b (a)
0: 

 [☿:default] test % hg log --template "{rev}: {join(file_copies,';')}\n"     
2: 
1: a
0: 

 [☿:default] test % hg version
Mercurial Distributed SCM (version 2.5.4+87-257afe5489d4+20130416)
Comment 4 HG Bot 2013-04-16 12:45 UTC
Fixed by http://selenic.com/repo/hg/rev/3cdb6f2f6789
Matt Mackall <mpm@selenic.com>
templatekw: add default styles for hybrid types (issue3887)

This allows elements like file_copies to be printed as 'name (source)'
when used with join.

(please test the fix)
Comment 5 Nikolaj Sjujskij 2013-04-17 00:54 UTC
Seems to be fixed.