Edgewall Software

Ticket #729 (closed enhancement: fixed)

Opened 4 years ago

Last modified 4 years ago

Remove wiki pages with trac-admin

Reported by: tv+nospam.edgewall_com.2a55fe@… Owned by: daniel
Priority: low Milestone: 0.9
Component: admin/console Version: 0.8.1
Severity: normal Keywords: helpwanted patch
Cc: nslater@…

Description (last modified by cmlenz) (diff)

There should be a way to remove wiki pages from the command line. Something like:

trac-admin ENV wiki remove PageName

Attachments

patch (1.8 KB) - added by nslater@… 4 years ago.
unified diff patch file for trac-admin

Change History

Changed 4 years ago by Matthew Good <matt-good.net>

Changeset [834] made it possible to delete Wiki pages through the web interface, so this should be available in version 0.8. I believe this would be the preferred way to delete Wiki pages. The changeset also provides a way to only delete a specific revision (i.e. revert the page), which would be easier to do through the web since you could see which revision you were deleting.

Is there a particular reason for wanting to perform the deletion through the command line as opposed to the web interface?

I believe the trac-admin tool should be reserved for initializing the environment and backend operations such as upgrading the database, importing a directory of Wiki pages, etc.

Changed 4 years ago by hpk at trillke net

I think it would make sense to be able to delete wiki pages.

For instance, i want my trac projects to start from scratch with just very few bootstrap pages. The welcome page will have a pointer to the central trac wiki because it makes no sense to me to duplicate these pages.

So going to all wiki pages and deleting them through the web seems somewhat cumbersome.

Changed 4 years ago by daniel

  • status changed from new to closed
  • resolution set to wontfix

the direction of Trac is to move away from trac-admin, in particularly for 2.0+.

Since it's already possible to delete pages from the standard web interface, it doesn't make much sense unless we have an extensive set of wiki page manipulation commands.

Changed 4 years ago by nslater@…

  • cc nslater@… added
  • status changed from closed to reopened
  • resolution wontfix deleted
  • severity changed from enhancement to normal

I agree with Matthew Good and think this ticket should be looked at again.

I am in the process of installing multiple Trac environments on a host and am writing a simple shell script that automatically sets them up for me. It has only now come to my attention that there is no way with this script to remove Trac's default Wiki contents.

Obviously for a new project, it is not desirable to start with Tracs default pages. But to have to use the web interface to initialise my Trac environments has seriously hindered my attempts at writing an automatic Trac install script.

Please provide a way to flush or delete Wiki pages via the command line. It makes logical sense, as every other element of trac-admin has an associated remove command.

Changed 4 years ago by cmlenz

  • keywords helpwanted added
  • description modified (diff)

I agree that this functionality would be nice. A patch would be welcome ;-)

Changed 4 years ago by nslater@…

It just ocured to me that you can use SQLite to connect directly to the trac.db and remove the pages manualy with SQL statements. This is very hackish though and I'm only posting here in case it helps someone else with any automated scripts.

Changed 4 years ago by nslater@…

I have attached a patch in unified diff format that fixes this problem.

I have never coded in python before, but I must say, this patch was a breeze. Sorry if I got anything wrong.

Changed 4 years ago by nslater@…

unified diff patch file for trac-admin

Changed 4 years ago by anonymous

  • keywords patch added
  • version changed from 0.7.1 to 0.8.1

Changed 4 years ago by cmlenz

  • priority changed from normal to low
  • status changed from reopened to closed
  • resolution set to fixed
  • severity changed from normal to enhancement
  • milestone set to 0.9

Patch applied in [1316]. Thanks!

Add/Change #729 (Remove wiki pages with trac-admin)

Author



Change Properties
<Author field>
Action
as closed
Next status will be 'reopened'
to The owner will change from daniel. Next status will be 'closed'
 
Note: See TracTickets for help on using tickets.