Skip to content

Hg merge fix #173

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

Closed
wants to merge 4 commits into from
Closed

Hg merge fix #173

wants to merge 4 commits into from

Conversation

martinvonz
Copy link
Contributor

This fixes an issue with importing merge commits from Mercurial.

Some tests created a `temp/` directory in the repo root before this
patch. It doesn't seem that any tests need to test with a particular
output root, so I just moved the existing calls to `setup()`.
…gOriginTest

I think it's clearer that `origin.resolve("1")` resolves to a commit
called "two", so I've renamed the commits to start from "zero" instead
of "one".
Consider this history (later commits higher up):

```
D   new import target
|\
| C new feature
| |
B | old import target
|/
A
```

Before this CL, when Copybara tries to import that from Mercurial, it
looks at the commits in Mercurial revset "B::D", which contains only B
and D. It will therefore miss commit C. IIUC, some later processing
also makes it skip the merge commit D, so it doesn't end up importing
anything. Well, it actually does seem to import B again, but that's
also doesn't seem desirable. Googlers can see my pending cl/372950711
for an example (at the time of mailing this CL). That CL should have
gotten the state in commit fde5bb5d1acf imported. Instead, it sees no
content changes and lists the already imported commit 48637f926817 in
the CL description.

I've updated the test case now that `HgOrigin.changes()` no longer
includes the `fromRef` value. I have not added a test case for the
merge issue becase I'm not familiar with the test setup. Let me know
if you'd like to me add a test case for that.
@google-cla google-cla bot added the cla: yes label May 11, 2021
@martinvonz martinvonz closed this May 11, 2021
@martinvonz martinvonz deleted the hg-merge-fix branch May 11, 2021 23:03
@martinvonz martinvonz mentioned this pull request May 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant