“回滚...”和“回滚...”有什么区别?和“退出提交的变更列表 #####”在 Perforce P4V 中

发布于 2024-09-01 03:40:41 字数 133 浏览 4 评论 0原文

我想撤消我的一次签到所做的更改。在特定变更列表的右键单击上下文菜单中,有以下两个选项:

  • 回滚...
  • 返回已提交的变更列表

这两个之间有什么区别?在什么情况下我应该使用其中之一?

I want to reverse the changes from one of my checkins. In the right-click context menu of the particular changelist, there are these two options:

  • Rollback...
  • Back Out Submitted Changelist

What is the difference between these two? In what situations should I use either one?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

谁的新欢旧爱 2024-09-08 03:40:41

这两个操作都会将一组文件恢复到以前的状态,并且本质上是比使用 p4 obliterate 命令更快、更安全的撤消错误的方法(并且您不需要管理员访问权限即可使用它们)。

在“回滚...”的情况下,这可以是任意数量的文件,甚至是整个仓库。您可以告诉它回滚到特定修订、更改列表或标签。文件将恢复到创建该修订、更改列表或标签时的状态。

对于“返回已提交的变更列表 #####”,恢复操作仅限于变更列表 ##### 中提交的文件。如果此后未对这些文件进行任何更改,这些文件将恢复到您提交该更改列表之前的状态。如果对这些文件中的任何一个进行了后续更改,Perforce 将告诉您这些文件现在已过时。您必须同步到头部修订版,然后解决差异。这样您就不会无意中破坏任何您真正想要保留的更改。

这两种操作本质上都是将旧修订版提交为新修订版。当您执行“回滚...”时,您会将文件恢复到特定时间点的状态,无论此后发生了什么。当您执行“退出...”时,您试图撤消在特定时间点所做的更改,同时保留此后发生的更改。

Both of these operations restore a set of files to a previous state and are essentially faster, safer ways of undoing mistakes than using the p4 obliterate command (and you don't need admin access to use them).

In the case of "Rollback...", this could be any number of files, even an entire depot. You can tell it to rollback to a specific revision, changelist, or label. The files are restored to the state they were in at the time of creation of that revision, changelist, or label.

In the case of "Back Out Submitted Changelist #####", the restore operation is restricted to the files that were submitted in changelist #####. Those files are restored to the state they were in before you submitted that changelist, provided no changes have been made to those files since. If subsequent changes have been made to any of those files, Perforce will tell you that those files are now out of date. You will have to sync to the head revision and then resolve the differences. This way you don't inadvertently clobber any changes that you actually want to keep.

Both operations work by essentially submitting old revisions as new revisions. When you perform a "Rollback...", you are restoring the files to the state they were in at a specific point in time, regardless of what has happened to them since. When you perform a "Back out...", you are attempting to undo the changes you made at a specific point in time, while maintaining the changes that have occurred since.

挽梦忆笙歌 2024-09-08 03:40:41

撤消更改列表提交

您无法撤消成功的更改列表提交,但可以通过两种方式撤消以前提交的更改:

回滚将一个文件或一组文件恢复到指定的更改列表、日期或修订版本。该时间点之后所做的任何更改都不会保留。
退出删除在给定更改列表、日期或修订中所做的特定更改,但允许用户保留在后续修订中所做的更改。

有关详细信息,请参阅 https://www.perforce.com /perforce/r13.1/manuals/p4v/Working_with_changelists.html

Reverse a changelist submission

You cannot undo a successful changelist submission, but you can reverse previously submitted changes in two ways:

Rollback restores a file or set of files back to a specified changelist, date or revision. Any changes made after that point in time are not retained.
Back out removes specific changes made at a given changelist, date or revision but allows a user to keep changes made in subsequent revisions.

For details please refer to https://www.perforce.com/perforce/r13.1/manuals/p4v/Working_with_changelists.html

咋地 2024-09-08 03:40:41

回退可恢复或撤消我们的更改。它执行此操作的方式是,P4 撤消本地工作区上的更改列表(默认或新)中的更改。然后,我们必须像处理其他变更列表一样提交/提交这个撤回的变更列表。第二部分在这里很重要,因为它不会自动回退服务器上的更改列表,我们必须提交回退的更改列表(这在您执行此操作后才有意义,但我最初假设它会自动执行此操作)。

正如其他人指出的,回滚具有更大的权力 - 它可以将更改恢复到特定日期、更改列表或修订#

Backout restores or undoes our changes. The way it does this is that, P4 undoes the changes in a changelist (default or new) on our local workspace. We then have to submit/commit this backedout changelist as we do other changeslists. The second part is important here, as it doesn't automatically backout the changelist on the server, we have to submit the backedout changelist (which makes sense after you do it, but i was initially assuming it does that automatically).

As pointed by others, Rollback has greater powers - It can restore changes to a specific date, changelist or a revision#

勿挽旧人 2024-09-08 03:40:41

回滚...将提示您选择要回滚的文件夹,即它将在特定文件夹上工作,并且您可以回滚到标签或更改列表或日期。取消对特定变更列表中的文件的处理。

Rollback... will prompt you to select a folder to rollback, ie, it will work on specific folders, and you can rollback to labels or changlists or dates. Back out works on the files in specific changelists.

瞄了个咪的 2024-09-08 03:40:41

我通过将 Perforce 变更列表与堆栈(来自数据结构)进行比较来向用户解释这一点。

退出会从堆栈中的任何位置删除一项。

回滚会从堆栈顶部删除 n 个项目。

I explain this to users by comparing Perforce changelists to a stack (from data structures).

Backing out removes one item from anywhere in the stack.

Rolling back removes n items from the top of the stack.

月依秋水 2024-09-08 03:40:41

最简单的区别是复数之一:

  • Backout退出单个更改列表(无论是否是最新的)。即它撤消单个更改列表。
  • 回滚会根据需要回滚更改,以便到达先前的更改列表。即它撤消多个更改列表。

我曾经忘记哪个是哪个,最后不得不查找很多次。为了解决这个问题,想象一下回滚几次轮换,然后希望 rollback 是复数这一事实将帮助您(和我!)记住哪个是哪个。对我来说,Backout 听起来比 rollback '复数更少'。想象一下从单个停车位倒车。

因此,助记符是:

  • 回滚→多次旋转
  • 退出→从单个停车位中退出

我希望这会有所帮助!

At its simplest, the difference is one of plurality:

  • Backout backs out of a single changelist (whether the most recent or not). i.e. it undoes a single changelist.
  • Rollback rolls back changes as much as it needs to in order to get to a previous changelist. i.e. it undoes multiple changelists.

I used to forget which one is which and end up having to look it up many times. To fix this problem, imagine rolling back as several rotations then hopefully the fact that rollback is plural will help you (and me!) remember which one is which. Backout sounds 'less plural' than rollback to me. Imagine backing out of a single parking space.

So, the mnemonic is:

  • Rollback → multiple rotations
  • Backout → back out of a single car parking space

I hope this helps!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文