Opened 20 years ago
Closed 20 years ago
#729 closed enhancement (fixed)
Remove wiki pages with trac-admin
Reported by: | Owned by: | daniel | |
---|---|---|---|
Priority: | low | Milestone: | 0.9 |
Component: | admin/console | Version: | 0.8.1 |
Severity: | normal | Keywords: | helpwanted patch |
Cc: | nslater@… | Branch: | |
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description (last modified by )
There should be a way to remove wiki pages from the command line. Something like:
trac-admin ENV wiki remove PageName
Attachments (1)
Change History (10)
comment:1 by , 20 years ago
comment:2 by , 20 years ago
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.
comment:3 by , 20 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
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.
comment:4 by , 20 years ago
Cc: | added |
---|---|
Resolution: | wontfix |
Severity: | enhancement → normal |
Status: | closed → reopened |
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.
comment:5 by , 20 years ago
Description: | modified (diff) |
---|---|
Keywords: | helpwanted added |
I agree that this functionality would be nice. A patch would be welcome ;-)
comment:6 by , 20 years ago
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.
comment:7 by , 20 years ago
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.
comment:8 by , 20 years ago
Keywords: | patch added |
---|---|
Version: | 0.7.1 → 0.8.1 |
comment:9 by , 20 years ago
Milestone: | → 0.9 |
---|---|
Priority: | normal → low |
Resolution: | → fixed |
Severity: | normal → enhancement |
Status: | reopened → closed |
Patch applied in [1316]. Thanks!
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.