#3549: Shorter description of files in a changeset
-----------------------------------+----------------------------------------
 Reporter:  [EMAIL PROTECTED]  |        Owner:  cboos
     Type:  enhancement            |       Status:  new  
 Priority:  lowest                 |    Milestone:  0.11 
Component:  changeset view         |      Version:       
 Severity:  normal                 |   Resolution:       
 Keywords:                         |  
-----------------------------------+----------------------------------------
Comment (by mgood):

 Replying to [comment:1 cboos]:
 > {{{
 >     location = os.path.dirname(os.path.commonprefix(files))
 > }}}

 Note that "commonprefix" works on sequences, which can lead to undesired
 behavior when using strings:
 {{{
 >>> files = ['trunk/trac/env.py', 'trunk/templates/index.cs']
 >>> os.path.commonprefix(files)
 'trunk/t'
 }}}

 So, it's usually best to split the strings on path separators, then join
 them back:
 {{{
 >>> '/'.join(os.path.commonprefix([f.split('/') for f in files]))
 'trunk'
 }}}

 Replying to [comment:2 eblot]:
 > This should be implemented as an optional feature (i.e. with a config
 option in trac.ini)

 Why?  I prefer not to make every UI change an option.  Every option just
 makes trac.ini and its documentation larger and more confusing.  I don't
 really see a particular reason ''not'' to display the base path of the
 changes.

-- 
Ticket URL: <http://trac.edgewall.org/ticket/3549#comment:6>
The Trac Project <http://trac.edgewall.com/>
_______________________________________________
Trac-Tickets mailing list
[email protected]
http://lists.edgewall.com/mailman/listinfo/trac-tickets

Reply via email to