![为什么我无法删除 Perforce 上的仓库?](https://linux22.com/image/1310266/%E4%B8%BA%E4%BB%80%E4%B9%88%E6%88%91%E6%97%A0%E6%B3%95%E5%88%A0%E9%99%A4%20Perforce%20%E4%B8%8A%E7%9A%84%E4%BB%93%E5%BA%93%EF%BC%9F.png)
我只是在本地 Perforce 数据库中乱搞,试图弄清楚如何将 Perforce 重置回以前的状态,而无需记录或删除并重新创建数据库文件。
我有一些没有文件的仓库,其中一个名为“沙盒”。我使用p4 depot
命令行或 P4Python API(目前我不记得是哪个了)创建了它。
当我输入:
p4 depot -d sandbox
我得到了这个:
仓库沙箱不为空。要删除仓库,必须删除所有文件修订,并且必须切断来自其他仓库的所有惰性副本引用。使用“p4 obliterate”或“p4 snap”断开来自其他仓库的文件链接,然后使用“p4 obliterate”清除此仓库,然后重试删除。
我试过p4 obliterate -y //sandbox/...
,只是说No records to delete.
这是可以预料的,因为仓库是空的。无论如何,它不会改变结果p4 depot -d
。正如错误消息所暗示的那样,也没有来自其他仓库的连接。
知道发生了什么吗?有没有一种万无一失的方法可以强制删除仓库,而无需完全删除服务器文件?最终,我想从 P4Python 自动执行此操作。
编辑:FWIW,这是消灭操作期间的服务器日志:
2012/04/11 09:30:18 pid 6916 username@machinename 127.0.0.1 [p4/2011.1/NTX86
/370818] 'user-obliterate -y //sandbox/...'
--- lapse .561s
--- rpc msgs/size in+out 0+1/0mb+0mb himarks 64836/64836
--- db.counters
--- pages in+out+cached 2+0+1
--- locks read/write 0/1 rows get+pos+scan put+del 0+0+0 0+0
--- total lock wait+held read/write 0ms+0ms/0ms+436ms
--- db.user
--- pages in+out+cached 2+0+1
--- locks read/write 1/0 rows get+pos+scan put+del 1+0+0 0+0
--- db.group
--- pages in+out+cached 2+0+1
--- locks read/write 1/0 rows get+pos+scan put+del 0+1+1 0+0
--- db.domain
--- pages in+out+cached 3+0+1
--- locks read/write 2/0 rows get+pos+scan put+del 1+2+8 0+0
--- total lock wait+held read/write 0ms+436ms/0ms+0ms
--- max lock wait+held read/write 0ms+436ms/0ms+0ms
--- db.view
--- pages in+out+cached 3+0+1
--- locks read/write 2/0 rows get+pos+scan put+del 0+2+6 0+0
--- total lock wait+held read/write 0ms+436ms/0ms+0ms
--- max lock wait+held read/write 0ms+436ms/0ms+0ms
--- db.integed
--- pages in+out+cached 3+0+2
--- locks read/write 0/1 rows get+pos+scan put+del 0+1+1 0+0
--- total lock wait+held read/write 0ms+0ms/0ms+390ms
--- db.resolve
--- pages in+out+cached 2+0+1
--- locks read/write 0/1 rows get+pos+scan put+del 0+0+0 0+0
--- total lock wait+held read/write 0ms+0ms/0ms+343ms
--- db.have
--- pages in+out+cached 3+0+2
--- locks read/write 0/1 rows get+pos+scan put+del 0+1+1 0+0
--- total lock wait+held read/write 0ms+0ms/0ms+296ms
--- db.label
--- pages in+out+cached 2+0+1
--- locks read/write 0/1 rows get+pos+scan put+del 0+0+0 0+0
--- total lock wait+held read/write 0ms+0ms/0ms+249ms
--- db.locks
--- pages in+out+cached 3+0+2
--- locks read/write 0/1 rows get+pos+scan put+del 0+1+1 0+0
--- total lock wait+held read/write 0ms+0ms/0ms+171ms
--- db.archmap
--- pages in+out+cached 2+0+1
--- locks read/write 1/0 rows get+pos+scan put+del 0+1+1 0+0
--- db.rev
--- pages in+out+cached 4+0+2
--- locks read/write 1/1 rows get+pos+scan put+del 0+2+2 0+0
--- total lock wait+held read/write 0ms+16ms/0ms+171ms
--- db.revcx
--- pages in+out+cached 2+0+1
--- locks read/write 0/1 rows get+pos+scan put+del 0+0+0 0+0
--- total lock wait+held read/write 0ms+0ms/0ms+140ms
--- db.revdx
--- pages in+out+cached 2+0+1
--- locks read/write 0/1 rows get+pos+scan put+del 0+0+0 0+0
--- total lock wait+held read/write 0ms+0ms/0ms+93ms
--- db.revhx
--- pages in+out+cached 2+0+1
--- locks read/write 0/1 rows get+pos+scan put+del 0+0+0 0+0
--- total lock wait+held read/write 0ms+0ms/0ms+62ms
--- db.revsx
--- pages in+out+cached 2+0+1
--- locks read/write 0/1 rows get+pos+scan put+del 0+0+0 0+0
--- total lock wait+held read/write 0ms+0ms/0ms+46ms
--- db.working
--- pages in+out+cached 2+0+1
--- locks read/write 0/1 rows get+pos+scan put+del 0+0+0 0+0
--- total lock wait+held read/write 0ms+0ms/0ms+31ms
--- db.traits
--- pages in+out+cached 4+3+2
--- locks read/write 0/1 rows get+pos+scan put+del 0+0+0 0+0
--- total lock wait+held read/write 0ms+0ms/0ms+31ms
--- db.protect
--- pages in+out+cached 2+0+1
--- locks read/write 1/0 rows get+pos+scan put+del 0+1+1 0+0
答案1
我用强制标志解决了这个问题
p4 depot -f -d sandbox
因为我的仓库文件夹包含一堆没有被删除的空文件夹。