Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make arc diff work with multiple heads in hg #28

Merged
merged 1 commit into from May 17, 2012

Conversation

@jlfwong
Copy link
Contributor

@jlfwong jlfwong commented May 17, 2012

When you have a commit history that looks like this:

@  11805 foo (bookmark: foo, not pushed)
|
| o  11804 bar (bookmark: bar, not pushed)
|/
o  11803 baz (already pushed)

If you're on foo (i.e. hg update 11805), and run arc diff, the diff that shows up on differential is correct, but the list of commits will contain both foo and bar.

This is because 11805:0 contains 11804. We actually only want things that are ancestors of the current revision, which we can get with ancestor(11805) instead.

These heads are the same hg branch, but are identified by different hg bookmarks (which are like lightweight git branches).

@epriestley
Copy link
Member

@epriestley epriestley commented May 17, 2012

Ah, thanks! Let's hope everyone has Mercurial 1.6 or newer -- this might actually cause issues but I can deal with it if it does.

epriestley pushed a commit that referenced this pull request May 17, 2012
Make arc diff work with multiple heads in hg
@epriestley epriestley merged commit 1369168 into phacility:master May 17, 2012
carlsverre pushed a commit to memsql/arcanist that referenced this pull request Mar 31, 2014
Summary:
This adds basic support for mutable history for arc diff and arc amend for
mercurial. This is purely opt-in (so it shouldn't affect anyone who doesn't want
this feature) by explicitly setting

    "immutable_history" : false

in arc configuration.

This also fixes another instance of weird behaviour for multiple heads - the
first instance was fixed here:
phacility/arcanist#28

Test Plan:
without "immutable_history" turned on)>

When ##arc diff## produces an update diff, it should list only commits that are
ancestors of the current revision - not ones from other heads.

Reviewers: epriestley

CC: csilvers, aran, Koolvin

Differential Revision: https://secure.phabricator.com/D2654
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants