A DRCS (git, bzr, merc) that has “pending changesets” like perforce?

We have perforce at work and one thing about it really seems to work quite well with the workflow and that is pending changesets.

I can make a new pending changeset, assign changes to it, assign jira tickets to it, etc… I can shelve files there and make other changes in other changesets. Then when it’s checkin time I can push just those changes by simply providing the changeset ID.

Do any of the main distributed revision control systems offer anything like this? I see that most offer a variant of shelving, but pending changesets?

Edit – an example to clarify:

I have a project with files A-Z. I do an update right before making changes for a source change I’m making. I notice that a change I’m not ready to adopt has been made so I create a hack around it by modifying A and B. I then make changes to files C, D, and E.

I only want to check in the latter three and I want to attach the jira ticket I’m responding to. In p4v this is as simple as creating a new “pending changeset” and checking off the files I want in it along with the ticket number. Then I commit my pending changeset. I can then keep my hack around for the next run or revert it.

  • How to use special SSH key for BitBucket and GitHub to push/pull?
  • Mercurial Undo Merge
  • Is there anything like svnserve for Mercurial?
  • How to treat uncompressed folder as compressed file?
  • What is the equivalent of hg up -C in git
  • Splitting existing repository & applying latest commits to another repository
  • Managing release branches in Mercurial
  • git log format for mercurial
  • 3 Solutions collect form web for “A DRCS (git, bzr, merc) that has “pending changesets” like perforce?”

    Mercurial has two features that are very similar to this. The first, and older one, is called Mercurial Queues these are based on Quilt but are integrated into Mercurial. That book chapter is worth reading, but they basically let you have a series of overlap changesets that can be pushed, popped, and edited willy-nilly. They differ from shelve (git’s or Mercurial’s) in that they can be pushed/pulled and can actually be version controlled themself in a separate queue-specific repo.

    The second, newer feature along those lines is the Phases feature. It tracks a phase for each changeset which can be public, draft, or secret. The wiki page has the full details but basically public is anything you’ve pushed to another repo,draft is anything you haven’t yet pushed (and thus can edit w/o worrying about breaking people’s histories), and private is a changeset that won’t be pushed when you hg push. You can use phases along with histedit and commit --amend and even Mercurial queues to make sure a changeset doesn’t leave your machine until you’re happy with it.

    Git has the concept of stashes, which are similar–you can have multiple stashes with descriptions of what’s in them. The main difference is that stashes are local, while P4’s pending changelists are on the server. That could be important if anyone else needs to see your pending changelists.

    Git also has the concept of the index. You can add files to the index and, by default, it only commits files that are in the index. You can modify a number of files and put some of them in the index and leave others in the workspace. You can even have one file modified and queued in the index and different modifications to that same file in the workspace.

    Git Baby is a git and github fan, let's start git clone.