This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 166178

Summary: Mercurial diff uses wrong "base"
Product: versioncontrol Reporter: serussellxxx <serussellxxx>
Component: MercurialAssignee: issues@versioncontrol <issues>
Status: VERIFIED FIXED    
Severity: blocker CC: mmirilovic, sustaining
Priority: P2    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

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 @@
   AAA
   BBB
  +DDD

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 @@
   AAA
  -CCC
  +BBB
  +DDD

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 http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/219edc21a4fd
User: Ondrej Vrabec <ovrabec@netbeans.org>
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.
http://hg.netbeans.org/release67_fixes/rev/6c83006dc19b