代码之家  ›  专栏  ›  技术社区  ›  Toby Allen mercator

强制还原不在工作区中的文件

  •  6
  • Toby Allen mercator  · 技术社区  · 17 年前

    p4 user -f -d auser
    User auser has file(s) open on 1 client(s) and can't be deleted.
    

    2 回复  |  直到 17 年前
        1
  •  5
  •   JohnGH    13 年前

    虽然这两个命令都没有返回任何内容:

    $ p4 clients -u <USER>
    
    $ p4 changes -s pending -u <USER>
    

    此命令显示了打开的文件:

    $ p4 opened -u <USER>
    //depot/path/to/file#1 - edit default change (text) by <USER>@<CLIENT>
    

    $ p4 -u <USER> -H <CLIENT> revert -k //depot/path/to/file
    //depot/path/to/file#1 - belongs to user <USER>, not reverted
    

    $ p4 client -o <CLIENT> > <CLIENT>.txt
    $ p4 client -d -f <CLIENT>
    $ p4 opened -u <USER>
    File(s) not opened anywhere.
    

    FTW!\o/

    如果需要,您可以使用以下命令重新创建客户端:

    $ p4 client
    

    <CLIENT>.txt p4 client -o <CLIENT>

    更多信息请点击此处: http://answers.perforce.com/articles/KB_Article/Reverting-Another-User-s-Files

        2
  •  1
  •   Toby Allen mercator    17 年前

    有点奇怪,但这就是我所做的。我得到了包含该文件的默认更改列表的详细信息。它的工作区名称是一台机器的名称。我登录了机器,然后以用户身份登录了performce。此时,我可以看到挂起的更改列表并还原文件。现在我可以删除用户了。

    这是怎么发生的?

    我认为发生的事情一定是客户的困惑。不久前,我更改了那台机器上相当多客户端的所有者(它是构建服务器),其中一些客户端肯定已经为旧用户打开了文件。这是我唯一能想到的解释。