472: HGTool does not support git style diff

dar****@gmai***** (Google Code) (Is this you? Claim this profile.)
Sept. 29, 2008
877
What's the URL of the page containing the problem?

http://localhost:8080/r/new/

What steps will reproduce the problem?
1. Add a mercurial repository
2. extract a git diff: hg diff --git /path/to/repository > mychanges.diff
3. Create a new review request using the diff file
4. Error message: the system could not recognize the diff file

What is the expected output? What do you see instead?

Expected output: diff recognized

What operating system are you using? What browser?

ubuntu, firefox

Please provide any additional information below.

none.
david
#1 david
Is this really an issue?  What exactly does "git style diff" mean?  Is this something
common?
david
#2 david
More detail in bug 499.
chipx86
#3 chipx86
  • +Component-SCMTools
david
#4 david
So, it turns out that "git-style diffs" from Hg don't include revision information.
There's no way we can support these.
  • +WontFix
#5 al.y****@gmai***** (Google Code) (Is this you? Claim this profile.)
Why not taking the most recent revision then (tip)? I don't see any reason of posting
a diff that does not apply on the most recent revision ...

BTW, Mercurial sources (Python, GPL v2) also parse those files, there might be some
interesting pieces to take there ... 
chipx86
#6 chipx86
It may be out of date. There's a massive race condition in doing that, and it can
break the diff in subtle or drastic ways.

Also, what is "most recent?" According to whose repository? When? We store the diff
and apply it when viewed, so it may be "most recent" when posted but 5 minutes, a
month, a year later, it won't be viewable anymore.
#8 john.*****@gmai***** (Google Code) (Is this you? Claim this profile.)
http://www.selenic.com/mercurial/bts/issue1268 is the relevant Mercurial bug
#9 ivazq******@gmai***** (Google Code) (Is this you? Claim this profile.)
Why can't it pull the revision info from the export header?
#10 glezos+*******@transi******* (Google Code) (Is this you? Claim this profile.)
The `hg export --git` command includes the revision information in the diff and could
be pulled like ivazqueznet mentions.

  $ hg export --help
  hg export [OPTION]... [-o OUTFILESPEC] REV...

  dump the header and diffs for one or more changesets

      Print the changeset header and diffs for one or more revisions.