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 72938 - Exported patches should use paths relative to CVS root
Summary: Exported patches should use paths relative to CVS root
Status: RESOLVED FIXED
Alias: None
Product: versioncontrol
Classification: Unclassified
Component: CVS (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: issues@versioncontrol
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-22 15:12 UTC by Jesse Glick
Modified: 2007-08-07 14:20 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2006-02-22 15:12:04 UTC
If I am working on files in a dir /space/src/nb_all which corresponds to a
netbeans.org CVS checkout, and I use Export Diff Patch..., I expect the
filenames in the patch to be relative to /space/src/nb_all. E.g. I want

ant/manifest.mf

which can be used as is by anyone with a CVS checkout of netbeans.org; but
instead I get

/space/src/nb_all/ant/manifest.mf

This makes the patch harder to apply e.g. from the command line: you need to use
some positive value for -p.
Comment 1 _ pkuzel 2006-02-22 17:02:51 UTC
NetBeans generates absolute paths but relative "Index:". My understatning was
that  patch prefers Index: entries.
Comment 2 Jesse Glick 2006-02-22 17:07:57 UTC
It is true that the Index paths are relative. The problem is that they are
relative to an apparently arbitrary root. For example:

Index: src/org/netbeans/modules/ant/freeform/jdkselection/Util.java
***
/space/src/nb_all/ant/freeform/samples/src/org/netbeans/modules/ant/freeform/jdkselection/Util.java
No Base Revision
---
/space/src/nb_all/ant/freeform/samples/src/org/netbeans/modules/ant/freeform/jdkselection/Util.java
Locally New

should read

Index:
ant/freeform/samples/src/org/netbeans/modules/ant/freeform/jdkselection/Util.java
***
/space/src/nb_all/ant/freeform/samples/src/org/netbeans/modules/ant/freeform/jdkselection/Util.java
No Base Revision
---
/space/src/nb_all/ant/freeform/samples/src/org/netbeans/modules/ant/freeform/jdkselection/Util.java
Locally New

Otherwise someone applying the patch needs to be told which dir to cd into in
order to apply it.

It seems that the basedir is chosen as whatever dir you happened to select when
doing Show Changes. (Not sure what it does if you select two dirs!) But that dir
is not significant except for limiting the scope of the files I want to scan.
The real root is the CVS root, i.e. the dir where CVS/Repository (if it exists)
would read ".".
Comment 3 Maros Sandor 2007-02-16 14:16:21 UTC
Sounds reasonable. Currently cvs generates patches relative to the closest
common parent directory of patched files.
Comment 4 Maros Sandor 2007-08-07 14:20:56 UTC
Index paths are now relative to CVS root. The patch can then be applied anywhere below or at CVS root.

/shared/data/ccvs/repository/javacvs/cvsmodule/src/org/netbeans/modules/versioning/system/cvss/ui/actions/diff/ExportDiffAction.java,v
 <--  ExportDiffAction.java
new revision: 1.42; previous revision: 1.41
/shared/data/ccvs/repository/javacvs/cvsmodule/src/org/netbeans/modules/versioning/system/cvss/ui/actions/diff/Bundle.properties,v
 <--  Bundle.properties
new revision: 1.27; previous revision: 1.26
/shared/data/ccvs/repository/diff/src/org/netbeans/modules/diff/builtin/ContextualPatch.java,v  <--  ContextualPatch.java
new revision: 1.6; previous revision: 1.5