How to delete pending changelist in perforce

How to delete pending changelist in perforce

 

up vote24down votefavorite

10

I have a workspace in perforce in which i made some files mark for delete. Now i want to delete that workspace forcefully. But i dont have admin rights. What to do. Please suggest some method. Thanks

share|improve this question

        asked Sep 6 '12 at 8:34

Steve Mark
131113

 

 

 

 

8 Answers                                8

activeoldestvotes

 

up vote28down vote

Run p4 opened to see all your opened files and run p4 revert to revert them.

Then run p4 changes -c your-client-name -s pending to see all your pending changelists. Since in the first step you reverted all your open files, these changelists will all be empty. Run p4 change -d change-number to delete each empty pending changelist.

Then you can run p4 client -d to delete your client.

share|improve this answer

edited Sep 6 '12 at 20:11

Dennis
10.2k12547

        answered Sep 6 '12 at 13:46

Bryan Pendleton
8,36921019

 

2

 

For reverting and deleting a pending changelist, I prefer this sequence:  p4 changes -u joe to list my pending changelists; p4 revert -c 12345 //... to revert all files in my pending changelist 12345 (for example); p4 change -d 12345 to delete the now-empty changelist.  HTH.–                     JeffroOct 19 '13 at 16:46

 

 

up vote22down vote

Why it's only 11 clicks in P4V, through an arbitrary sequence of menu items.

  1. Right click on the changelist
  2. Delete shelved files
  3. 'Yes'
  4. Right click on the changelist
  5. Remove all jobs
  6. Right click on the changelist
  7. Revert files
  8. 'Revert'
  9. Right click on the changelist
  10. Delete pending changelist
  11. 'Yes'

Let's send Perforce to usability school.

share|improve this answer

edited Jun 20 '13 at 9:35

 


 

        answered Feb 14 '13 at 10:01

Colonel Panic
27.3k15118179

 

 

 

 

up vote5down vote

Here is what I did to empty my default change set, which had a lot of files checked out for edit:

p4 opened | sed 's/#.*$//g' | xargs -iF p4 revert F

This will cut off the comment part from the filename produced by p4 opened and pipe the filename to p4 revert. After that I had nothing pending and p4 changes -c my-client-name -s pending yields nothing. If you have a huge change set this will take a while.

share|improve this answer

        answered Apr 4 '13 at 13:15

Juve
3,32042746

 

 

 

Love this.. Thanks Man!–                     Atif Mohammed AmeenuddinFeb 11 at 7:49

 

 

No need for xargs here (and especially no need for the -i option, which is unportable and deprecated even on Linux). Use p4 -x - instead (see p4 help usage). Also, to avoid the wait when you have a huge change set, use the -k option to p4 revert.–                     Gareth ReesMar 31 at 12:41

 

up vote2down vote

Here's a scriptable procedure for deleting a Perforce client. Use with care: this deletes all your work in progress on the client!

  1. Revert all changed files on this client.

    p4 -c $CLIENT revert -k //...

    Note the use of the -k option, which "marks the file as reverted in server metadata without altering files in the client workspace". Since we are going to delete the client later, we don't care about updating the client workspace. This speeds things up if you have many files open.

  2. Delete all shelved files from pending changes associated with the client.

    p4 changes -s shelved -c $CLIENT | cut -d' ' -f2 |while read CHANGE; do p4 shelve -c $CHANGE -d //...; done

    If you never use p4 shelve you can omit this step.

  3. All pending changes associated with the client are now empty. Delete them.

    p4 changes -s pending -c $CLIENT | cut -d' ' -f2 | p4 -b 1 -x - change -d

  4. There are now no pending changes associated with the client. Delete the client.

    p4 client -d $CLIENT

(This process ought to be much easier! In particular, there seems no good reason why we have to delete shelved files associated with a client before deleting the client. If you find yourself struggling with this, do contact Perforce support and suggest that it be made simpler.)

share|improve this answer

edited Sep 4 at 20:16

 


 

        answered Mar 31 at 10:59

Gareth Rees
32.9k356102

 

 

 

I had shelved changes on another host (after switching computers). To be able to do step 2, I had to change the host of the workspace to my current one.–                     tunerJul 22 at 16:05

 

 

The help suggests that you can use the -f option to force the deletion despite the mismatch. (You'll need "admin" permission though.)–                     Gareth ReesJul 22 at 16:54

 

 

The question was explicitly telling that no admin rights are available. I guess that is the case for most people who do professional work (=being paid for) with perforce.–                     tunerJul 23 at 8:08

 

 

Awesome!  Step 3 didn't work for me. Was getting "Usage: change -d [ -f ] [ -O ] changelist# Missing/wrong number of arguments."  Slight modification worked (Mavericks): p4 changes -s pending -c $CLIENT | cut -d' ' -f2 | xargs -n 1 p4 change -d–                     MoosSep 4 at 19:55

 

 

@Moos: Thanks for spotting my mistake! As an alternative to xargs, you can use -b 1 to batch the arguments to p4.–                     Gareth ReesSep 4 at 20:17

 

up vote1down vote

Wrote this script called p4-delete-client for deleting p4 changelists.

Note that it relies on other scripts in the repo.

share|improve this answer

edited Aug 12 at 9:04

 


 

        answered Aug 4 at 6:48

Arnon Zilca
886215

 

 

 

 

up vote0down vote

try those steps :

  1. 1.Right click on the changelist

  2. Choose 'Change Ownership'

  3. In the workspace box choose already existing workspace and click OK

  4. right click on changelist  and choose delete and than ok.

share|improve this answer

        answered Aug 25 at 11:30

aristotaly
132111

 

 

 

 

up vote0down vote

try those steps (P4V) :

1.Right click on the changelist

Choose 'Change Ownership'

In the workspace box choose already existing workspace and click OK

right click on changelist and choose delete and than ok.

share|improve this answer

        answered Aug 25 at 11:32

aristotaly
132111

 

 

 

 

up vote0down vote

This just worked for me in P4V for resetting the default changelist:

  1. Right click on the default changelist and choose "Edit Pending Changelist 'default'"

  2. Click the button on the bottom right "Save as numbered changelist"

  3. Right click on the new changelist and choose "Delete changelist XXX"

You can also right click on the new changelist to revert the files for whatever you need to do, which is not available as an option on the default changelist.

share|improve this answer

        answered Aug 28 at 3:35

John Starr Dewar
7611011

 

http://stackoverflow.com/questions/12296080/how-to-delete-pending-changelist-in-perforce/14872182

<think>根据用户之前的内容,他提到代码单元未执行的问题可能与输入挂起有关。用户现在询问的是“codecellnotexecutedduetopendinginput”的解决方案。首先,我们需要理解这个错误信息。在编程环境中(尤其是JupyterNotebook或类似交互式环境),当代码单元因为等待用户输入而挂起(pendinginput)时,会导致该单元无法执行完成。这通常发生在代码中包含了需要用户交互输入的函数(如Python的input()函数),但环境无法提供交互式输入的情况下。解决方案通常有几种:1.避免在非交互式环境中使用交互式输入函数。如果环境不支持(例如在脚本或某些云端Notebook环境中),则应该修改代码,使用其他方式获取输入(如从文件、环境变量等)。2.如果确实需要交互,检查环境是否支持,并确保焦点在输入框上。有时候在Jupyter中,如果浏览器标签没有激活,可能导致输入延迟。3.使用替代方法模拟输入,例如预先设置变量来替代input()的调用。由于用户之前提到是“codecellnotexecuted”,我们假设他可能是在JupyterNotebook中遇到这个问题。因此,我们给出针对Jupyter的解决方案。另外,注意用户提到“可能与输入挂起有关”,所以重点放在处理input()函数上。下面我们将分步骤说明如何解决。</think> 在Jupyter Notebook/Colab等交互环境中出现`code cell not executed due to pending input`错误时,通常是由于代码需要用户交互输入,但环境无法捕获输入流导致的。以下是系统级解决方案: ### 根本原因分析 1. **挂起输入问题**:代码包含`input()`等交互函数 $$ \text{input("Enter value: ")} $$ 但内核无法在非终端环境捕获输入流[^1] 2. **缓冲区阻塞**:未处理的标准输入缓冲区残留数据 $$ \text{sys.stdin.flush()} $$ 未执行时会导致后续输入阻塞 3. **内核状态异常**: ```python import IPython IPython.get_ipython().kernel.dispatch_queue # 检查任务队列 ``` ### 分层解决方案 #### 1️⃣ 代码层修改(首选) ```python # 方法1:重定向输入流 from io import StringIO sys.stdin = StringIO("预设值\n") # 自动提供输入 # 方法2:条件跳过交互 if 'get_ipython' in globals(): # 检查是否在Notebook环境 param = "默认值" # 自动赋默认值 else: param = input("Enter: ") ``` #### 2️⃣ 运行时解决方案 ```bash # 重启内核后执行 !jupyter kernel restart --force # Colab/Jupyter通用 ``` #### 3️⃣ 系统级修复 ```python # 清除输入缓冲区残留 import sys, select while select.select([sys.stdin], [], [], 0)[0]: sys.stdin.readline() ``` ### 验证流程 1. 检查输入依赖: ```python import ast [n.name for n in ast.walk(ast.parse(code)) if isinstance(n, ast.Call) and n.func.id=="input"] ``` 2. 执行单元前重置内核: ```python from IPython.display import Javascript Javascript("Jupyter.notebook.kernel.restart()") ``` > **关键建议**:生产代码中避免直接使用`input()`,改用配置文件/环境变量: ```python import os value = os.getenv("PARAM") # 通过环境变量注入 ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值