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.
Summary: | support lock feature | ||
---|---|---|---|
Product: | versioncontrol | Reporter: | abs <abs> |
Component: | Subversion | Assignee: | issues@versioncontrol <issues> |
Status: | RESOLVED FIXED | ||
Severity: | blocker | CC: | anebuzelsky, brviking, mmirilovic, tprochazka |
Priority: | P1 | Keywords: | PLAN |
Version: | 6.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | ENHANCEMENT | Exception Reporter: |
Description
abs
2007-02-11 14:19:40 UTC
*** Issue 115435 has been marked as a duplicate of this issue. *** *** Issue 129564 has been marked as a duplicate of this issue. *** *** Issue 135466 has been marked as a duplicate of this issue. *** Will be supported also svn:needs-lock property? Please, add the following two classes in org.netbeans.modules.subversion.client.cli.commands public class LockCommand extends SvnCommand { private final File[] files; private final String message; private final boolean force; public LockCommand(File[] files, String message, boolean force) { this.files = files; this.message = message; this.force = force; } @Override protected int getCommand() { return ISVNNotifyListener.Command.LOCK; } @Override public void prepareCommand(Arguments arguments) throws IOException { arguments.add("lock"); if (force) { arguments.add("--force"); } arguments.addMessage(message); arguments.addFileArguments(files); setCommandWorkingDirectory(files); } } public class UnlockCommand extends SvnCommand { private final File[] files; private final boolean force; public UnlockCommand(File[] files, boolean force) { this.files = files; this.force = force; } @Override protected int getCommand() { return ISVNNotifyListener.Command.UNLOCK; } @Override public void prepareCommand(Arguments arguments) throws IOException { arguments.add("unlock"); if (force) { arguments.add("--force"); } arguments.addFileArguments(files); setCommandWorkingDirectory(files); } } And make the following changes in org.netbeans.modules.subversion.client.cli.CommandlineClient, instead of throw new UnsupportedOperationException("Not supported yet."); public void lock(File[] files, String message, boolean force) throws SVNClientException { LockCommand cmd = new LockCommand(files, message, force); exec(cmd); } public void unlock(File[] files, boolean force) throws SVNClientException { UnlockCommand cmd = new UnlockCommand(files, force); exec(cmd); } I have just test it, it's worked: SvnClient client = Subversion.getInstance().getClient(file); client.lock(new File[]{file}, "test lock", false); This feature would be very welcome, I also need it and currently I must lock/unlock files via commandline svn The feature would be very appreciated by me and by a lot of collegues of mine that are using Netbeans, too. This feature is really important! How is the progress to add this feature? This bus was opened in 2007 and we have no response yeat! Thank's due to the current resource situation in the vcs team this issue won't be impleneted in 6.9 (In reply to comment #5) > Please, add the following two classes in > org.netbeans.modules.subversion.client.cli.commands > public class LockCommand extends SvnCommand { > private final File[] files; > private final String message; > private final boolean force; > public LockCommand(File[] files, String message, boolean force) { > this.files = files; > this.message = message; > this.force = force; > } > @Override > protected int getCommand() { > return ISVNNotifyListener.Command.LOCK; > } > @Override > public void prepareCommand(Arguments arguments) throws IOException { > arguments.add("lock"); > if (force) { > arguments.add("--force"); > } > arguments.addMessage(message); > arguments.addFileArguments(files); > setCommandWorkingDirectory(files); > } > } > public class UnlockCommand extends SvnCommand { > private final File[] files; > private final boolean force; > public UnlockCommand(File[] files, boolean force) { > this.files = files; > this.force = force; > } > @Override > protected int getCommand() { > return ISVNNotifyListener.Command.UNLOCK; > } > @Override > public void prepareCommand(Arguments arguments) throws IOException { > arguments.add("unlock"); > if (force) { > arguments.add("--force"); > } > arguments.addFileArguments(files); > setCommandWorkingDirectory(files); > } > } > And make the following changes in > org.netbeans.modules.subversion.client.cli.CommandlineClient, > instead of throw new UnsupportedOperationException("Not supported yet."); > public void lock(File[] files, String message, boolean force) throws > SVNClientException { > LockCommand cmd = new LockCommand(files, message, force); > exec(cmd); > } > public void unlock(File[] files, boolean force) throws SVNClientException { > UnlockCommand cmd = new UnlockCommand(files, force); > exec(cmd); > } > I have just test it, it's worked: > SvnClient client = Subversion.getInstance().getClient(file); > client.lock(new File[]{file}, "test lock", false); While waiting for this feature to be included in a netbeans release, I thought it was a great idea to include your lines, and recompile the module. I did, and It seems to work fine. However, Im not sure how to get the menu items for lock/unlock into the context menu. Do you, or anyone else perhaps know how to acomplish this? o.n.m.subversion.Annotator.getActions(...) could be a good entry point - create your own action. Subclass from ContextAction if it's supposed to be context sensitive - e.g. IgnoreAction or StatusAction are simple enough and should give you an idea what to do. - add it to the list returned in getActions(...) - once for main menu and once for the context menu i need this feature What's the new milestone for this feature now that 6.9 has passed? I really need this feature ! any updates on it ? would it be included in the NetBeans 7 ? > would it be included in the NetBeans 7?
No. Due to limited resources we have we do not plan to implement this feature any time soon, contribution and patches are welcome.
So how long do we have to wait?! It is a simple issue, could be solved really easy, and we've been waiting 4 years already! Could I tell my grand children this is something they can expect to be blessed with? :) As NB is use the system svn, files can be locked at command line too. I went for another IDE in the end. :-( Sorry. anebuzelsky, 33 votes - candidate for NB 7.1 I hope . Some notes about the feature: http://netbeans.org/projects/versioncontrol/pages/Svn_lock. Look at the wiki page and let us know if you think something should look or be approached differently @ovrabec I find your proposal sound, particularly the "on demand locking", which I find particularly useful! The proposal sounds very good, indeed it is way overkill for our needs. The On demand locking should be default off, if you ask me. There usually is a good reason for setting the "needs-lock" property. Furthermore, don't contact the server unless requested - most files are not locked and we don't need more lag in Netbeans :) ok, time for implementation (In reply to comment #23) > fix: http://hg.netbeans.org/core-main/rev/a5b5ff38bb1e text annotations for now Integrated into 'main-golden', will be available in build *201105280401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/a5b5ff38bb1e User: Ondrej Vrabec <ovrabec@netbeans.org> Log: Issue #95177 - support lock feature annotate labels for locked files Integrated into 'main-golden', will be available in build *201105310954* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/c10219dde10f User: Ondrej Vrabec <ovrabec@netbeans.org> Log: Issue #95177 - support lock feature lock and unlock actions Integrated into 'main-golden', will be available in build *201106010401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/c10219dde10f User: Ondrej Vrabec <ovrabec@netbeans.org> Log: Issue #95177 - support lock feature lock and unlock actions Integrated into 'main-golden', will be available in build *201106021001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/c10219dde10f User: Ondrej Vrabec <ovrabec@netbeans.org> Log: Issue #95177 - support lock feature lock and unlock actions Could anyone check it in http://bits.netbeans.org/download/trunk/nightly/latest/ and give us some feedback before it's too late and 7.1 is out? Tested on my system: Product Version: NetBeans IDE Dev (Build 201106080600) Java: 1.6.0_24; Java HotSpot(TM) 64-Bit Server VM 19.1-b02 System: Windows 7 version 6.1 running on amd64; Cp1252; no_NO (nb) Works smoothly, including the editor switching to/from readonly-mode nicely. One issue: No errors/messages are shown if it fails - neither as an error dialog (preferrable), or as a message in the IDE status bar. In my case it failed because of an authentication issue. When I tried commit'ing instead, I got the authentication dialog (as I should). After authenticating it worked. Well done! Please add some error handling and it is good for 7.1! (In reply to comment #31) > neither as an error dialog (preferrable) i am against, raising a dialog for a background task (that is not triggered by an explicit user action) is IMO a bad idea. Especially to users who might not expect it, this could be really troublesome. For example in case you are not connected to network. > or as a message in the IDE status bar That's an option, plus can be logged in the output window (In reply to comment #32) > (In reply to comment #31) > > neither as an error dialog (preferrable) > i am against, raising a dialog for a background task (that is not triggered by > an explicit user action) is IMO a bad idea. Especially to users who might not > expect it, this could be really troublesome. For example in case you are not > connected to network. > > or as a message in the IDE status bar > That's an option, plus can be logged in the output window I agree, sort of, but this was not a background task, it was triggered by me choosing the "Lock" command. (Can this be started as background task?? I'm against) However, I didn't check the output window, so I checked it now, and it doesn't make sense: ==[IDE]== 09.jun.2011 14:47:43 Locking Files... lock -m "i need lock" myfile.xml Autorisasjonen feilet svn: User canceled dialog But I didn't get any authentication dialog!? (Btw: "Autorisasjonen feilet" means "Authentication failed", don't know why it shows in Norwegian) I thought you were talking about on-demand locking. But i can see now what the problem is. I don't know why, but our external svn client library does not throw an Authentication exception when lock/unlock fails (while it does for all other commands). So we cannot react properly to this with raising the authentication dialog. See the commented ex: http://subclipse.tigris.org/source/browse/subclipse/trunk/svnClientAdapter/src/javahl/org/tigris/subversion/svnclientadapter/javahl/AbstractJhlClientAdapter.java?view=diff&r1=1794&r2=1795&pathrev=4898 This is indeed a bug and we should deal with it, i filed a bug: #199309 |