Bug 694698 - Request for "publican rename" feature
Summary: Request for "publican rename" feature
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Publican
Classification: Community
Component: publican
Version: future
Hardware: All
OS: Linux
unspecified
low
Target Milestone: ---
Assignee: Jeff Fearn 🐞
QA Contact: Ruediger Landmann
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-04-08 03:45 UTC by Kate Grainger
Modified: 2011-07-26 00:42 UTC (History)
3 users (show)

Fixed In Version: 2.6
Clone Of:
Environment:
Last Closed: 2011-07-26 00:42:42 UTC
Embargoed:


Attachments (Terms of Use)

Description Kate Grainger 2011-04-08 03:45:36 UTC
Description of problem:
When I change the title of a book, I have to change it in a billion (ok, 4) places and it's annoying and takes time better spent elsewhere.

How reproducible:
Very, with any new product comes name changes (and title changes). 

Steps to Reproduce:
1. Make a book with Title1.
2. Get word that your book now needs to have Title2.
3. Change the title in a billion places.
4. Get annoyed.
  
Actual results:
"Ugh, another name change?" and grumbling.

Expected results:
"Another name change? Sure, no problem!" and jubilation.

Additional info:
Please, sirs, can I have:
"publican rename" 
1. publican clean
2. change: the name of ent and xml files, and that entity, and the book_info <title> element, to be all the same thing

Comment 1 Rebecca Newton 2011-04-08 03:46:48 UTC
+1!

Comment 2 Jeff Fearn 🐞 2011-04-08 03:58:27 UTC
Well we have a distinct lack of jubilation, but the problem I see with this is SCM related. The files will no longer match what is in SVN/GIT/??? and that will have to be done manually.

Cheers, Jeff.

Comment 3 Jeff Fearn 🐞 2011-04-08 05:19:55 UTC
Just to clarify:

(In reply to comment #2)
> Well we have a distinct lack of jubilation,

This is sad but true, and it would be nice to get some jubilation!

> but the problem I see with this is
> SCM related. The files will no longer match what is in SVN/GIT/??? and that
> will have to be done manually.

If you are OK with this limitation then we can do this for Publican 3.

Cheers, Jeff.

Comment 4 Kate Grainger 2011-04-08 05:29:31 UTC
Hooray, I thought it was a rule that everyone's first RFE gets shot down, so that's great news! I feel...I feel...jubilant! 

I'm perfectly happy with that limitation, especially if publican rename gives me a friendly reminder to move about my files when it has successfully completed. (*hint hint*)

Comment 5 Jeff Fearn 🐞 2011-04-18 06:41:41 UTC
As part of #688585 a new parameter was added, mainfile, so I should be able to get this working without renaming any files, which makes the impact on repositories go away!

Comment 6 Kate Grainger 2011-04-18 07:02:19 UTC
<jubilation in the village>
:D

Comment 7 Jeff Fearn 🐞 2011-04-19 01:58:11 UTC
Added rename action.

Committed revision 1758.

$ publican --help rename
rename
    Rename a publican book

    Options:
<snip common options>
        --name=<NAME>             The name of the book, article, set, or brand
        --product=<PRODUCT>       The name of the product
        --version=<VERSION>       The version of the product


$ publican package --lang en-US
Wrote: /home/jfearn/Source/fedora/publican/trunk/publican/Users_Guide/build/rpm/Publican-Users_Guide-2.6-web-en-US-2.6-1.el5.src.rpm

$ publican rename --name "New Book Name" --product "New Product" --version 3.0

$ publican package --lang en-US
/Wrote: home/jfearn/Source/fedora/publican/trunk/publican/Users_Guide/build/rpm/New_Product-New_Book_Name-3.0-web-en-US-2.6-1.el5.src.rpm

$ svn status
M       en-US/Book_Info.xml
M       publican.cfg

Comment 8 Jeff Fearn 🐞 2011-07-07 10:16:42 UTC
Back ported to branches/publican-2x

Committed revision 1810.

Comment 9 Rebecca Newton 2011-07-12 06:43:01 UTC
Hi Jeff, I'm just testing this to make the stage all better, and I'm not sure what the expected behavior of this is. I thought it would rename the actual local .ent and .xml files or even the folder itself, but all I can see is it changing the <productname>, <productnumber> and <title> in the Book_Info.xml. 

I have probably completely misunderstood, haven't I?

Comment 10 Jeff Fearn 🐞 2011-07-12 06:51:18 UTC
(In reply to comment #9)
> Hi Jeff, I'm just testing this to make the stage all better, and I'm not sure
> what the expected behavior of this is. I thought it would rename the actual
> local .ent and .xml files or even the folder itself, but all I can see is it
> changing the <productname>, <productnumber> and <title> in the Book_Info.xml. 
> 
> I have probably completely misunderstood, haven't I?

Hi, changing the file names would mean having to work out what SCM was being used then supporting every SCM to rename the file and not lose history. This was deemed too error prone. So what we do is modify the publican config so that it uses the new book name and the old book file, meaning we keep SCM history and don't need to rename files. Building the package should use the new book name.

Cheers, Jeff.

Comment 11 Rebecca Newton 2011-07-12 23:36:10 UTC
Okay, thanks. In that case, I can verify that this works as expected!


Note You need to log in before you can comment on or make changes to this bug.