From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Wasserman, Sherry" To: "'Yngve Svendsen'" , Hans-Albert.Schneider@mchp.siemens.de, gnats-devel@sources.redhat.com Subject: RE: Renaming a category? Date: Mon, 23 Apr 2001 08:39:00 -0000 Message-id: <6B1DF6EEBA51D31182F2009027404368026FFDD8@mail-in.comverse-in.com> X-SW-Source: 2001-q2/msg00046.html Hello, If others have access to the gnats database while you are changing the category, you should probably be concerned about locking the PRs. If you change the category field manually (by using gnatsweb or edit-pr), the normal PR locking mechanism will prevent changes (yours or theirs) from being overwritten. The PR will also be moved to the new category location and the index entry will be created by the software. You won't have to do gen-index. If you use sed, you should either lock the PRs that are going to be changed (pr-edit --lock), or lock gnats by creating the gnats.lock file in the gnats-admin directory. (Don't forget to remove the locks it when you're done.) I recently created a tool to move all PRs from one category to another with the following command: perl catmove [-d gnats_root] ... I'll be happy to send this, if you are interested. Sherry Wasserman Comverse 1025 Briggs Rd., Suite 100 Mt. Laurel, NJ 08054 Voice (856) 608-2858 Fax (856) 866-8850 > -----Original Message----- > From: Yngve Svendsen [ mailto:yngve.svendsen@clustra.com ] > Sent: Monday, April 23, 2001 9:35 AM > To: Hans-Albert.Schneider@mchp.siemens.de; > gnats-devel@sources.redhat.com > Subject: Re: Renaming a category? > > > At 15:26 23.04.2001 +0200, Hans-Albert Schneider wrote: > >What is the preferred way to rename a category? > > > >For GNATS 3.113, I am currently aware of the following procedure > >(assume renaming from "A" to "B"): > > > >1) Create a new category "B". > >2) Edit each report in "A", changing the category to "B". > >3) Remove category "A". > >4) Run gen-index. > > > >(I once tried to just rename the directory from "A" to "B" (and > >the entry in gnats-adm/categories, of course), and found that > >gen-index produced A/17 instead of B/17, because the Category > >field had not been changed. This was probably with an earlier > >version than 3.113; is gen-index now more clever about this?) > > > > > >Is there an easier way? Maybe with version 4? > > > >In step 2), do I need to invoke edit-pr and manually edit all > >reports, or can I just run something like > > > > for each report $n in category A, > > sed -e "/^>Category:/ s/A/B/" < A/$n > B/$n > > rm A/$n > > I don't think there is a better way. I have had to do the > same thing myself > on a few occasions. Automating step 2 should be OK, though. > Gnats4 has no > improvements with regards to this. This might be an idea for > a new admin > tool in a future version. > > > > Yngve Svendsen > IS Engineer > Clustra AS, Trondheim, Norway > yngve.svendsen@clustra.com > Cell.: +47 913 915 02 >