Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 166178 - Mercurial diff uses wrong "base"
Mercurial diff uses wrong "base"
Product: versioncontrol
Classification: Unclassified
Component: Mercurial
All All
: P2 (vote)
: 6.x
Assigned To: issues@versioncontrol
Depends on:
  Show dependency treegraph
Reported: 2009-05-28 14:06 UTC by serussellxxx
Modified: 2009-07-21 17:03 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT


Note You need to log in before you can comment on or make changes to this bug.
Description serussellxxx 2009-05-28 14:06:42 UTC
NetBeans' Mercurial "diff" command diffs against the tip revision, not the parent of the current revision.  This means
that if the workspace is in a branch, the diffs will be wrong.

Steps to reproduce:

  hg init
  echo "AAA" > A
  hg addremove
  hg ci -m "1"
  hg branch X
  echo "BBB" >> A
  hg ci -m "2"
  hg up -r default
  echo "CCC" >> A
  hg ci -m "3"
  hg up -r X
  echo "DDD" >> A

Now, create a project from this directory.  "hg diff" will show the correct diff:

  1132 % hg diff
  diff -r 2706f3fba91b A
  --- a/A Thu May 28 08:59:27 2009 -0400
  +++ b/A Thu May 28 08:59:32 2009 -0400
  @@ -1,2 +1,3 @@

But in Netbeans, the diff will show the changes compared to the tip of the "default" branch, which matches what it
exports when you choose "export uncommitted changes":

  # This patch file was generated by NetBeans IDE
  # Following Index: paths are relative to: /home/ser/Temp
  # This patch can be applied using context Tools: Patch action on respective folder.
  # It uses platform neutral UTF-8 encoding and \n newlines.
  # Above lines and this line are ignored by the patching process.
  Index: A
  --- A Base (BASE)
  +++ A Locally Modified (Based On LOCAL)
  @@ -1,2 +1,3 @@

This is wrong, since it does not agree with "hg diff."  Netbeans should always compare against the parent (which is
where any commit will occur), not against some other branch tip.
Comment 1 Ondrej Vrabec 2009-05-29 16:48:14 UTC
fix: cdev #219edc21a4fd

We used tip as the requested revision, now we use the default value - which should select parent
Comment 2 Quality Engineering 2009-05-30 06:44:19 UTC
Integrated into 'main-golden', will be available in build *200905300201* on (upload may still be in progress)
User: Ondrej Vrabec <>
Log: #166178 - Mercurial diff uses wrong "base"
do not set tip for the requested revision, but rather use the default one - parent
Comment 3 serussellxxx 2009-06-02 15:58:27 UTC
Thanks.  It looks like it is working correctly now.
Comment 4 pgebauer 2009-07-02 11:39:45 UTC
The fix has been ported into the release67_fixes repository.

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo