diff options
Diffstat (limited to 'plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/PropertiesComponent.java')
-rw-r--r-- | plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/PropertiesComponent.java | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/PropertiesComponent.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/PropertiesComponent.java index 860c524ed591..cd504be56077 100644 --- a/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/PropertiesComponent.java +++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/PropertiesComponent.java @@ -37,9 +37,12 @@ import org.jetbrains.annotations.Nullable; import org.jetbrains.idea.svn.SvnPropertyKeys; import org.jetbrains.idea.svn.SvnVcs; import org.jetbrains.idea.svn.api.Depth; -import org.tmatesoft.svn.core.*; -import org.tmatesoft.svn.core.wc.ISVNPropertyHandler; -import org.tmatesoft.svn.core.wc.SVNPropertyData; +import org.jetbrains.idea.svn.properties.PropertyConsumer; +import org.jetbrains.idea.svn.properties.PropertyData; +import org.jetbrains.idea.svn.properties.PropertyValue; +import org.tmatesoft.svn.core.SVNException; +import org.tmatesoft.svn.core.SVNProperty; +import org.tmatesoft.svn.core.SVNURL; import org.tmatesoft.svn.core.wc.SVNRevision; import org.tmatesoft.svn.core.wc2.SvnTarget; @@ -151,20 +154,20 @@ public class PropertiesComponent extends JPanel { } } - private void collectProperties(@NotNull SvnVcs vcs, @NotNull File file, @NotNull final Map<String, String> props) { + private static void collectProperties(@NotNull SvnVcs vcs, @NotNull File file, @NotNull final Map<String, String> props) { try { - ISVNPropertyHandler handler = new ISVNPropertyHandler() { - public void handleProperty(File path, SVNPropertyData property) throws SVNException { - final SVNPropertyValue value = property.getValue(); + PropertyConsumer handler = new PropertyConsumer() { + public void handleProperty(File path, PropertyData property) throws SVNException { + final PropertyValue value = property.getValue(); if (value != null) { - props.put(property.getName(), SVNPropertyValue.getPropertyAsString(property.getValue())); + props.put(property.getName(), PropertyValue.toString(property.getValue())); } } - public void handleProperty(SVNURL url, SVNPropertyData property) throws SVNException { + public void handleProperty(SVNURL url, PropertyData property) throws SVNException { } - public void handleProperty(long revision, SVNPropertyData property) throws SVNException { + public void handleProperty(long revision, PropertyData property) throws SVNException { } }; vcs.getFactory(file).createPropertyClient().list(SvnTarget.fromFile(file, SVNRevision.UNDEFINED), SVNRevision.WORKING, Depth.EMPTY, @@ -229,10 +232,12 @@ public class PropertiesComponent extends JPanel { String url = "file://" + myFile.getPath().replace(File.separatorChar, '/'); VirtualFile file = VirtualFileManager.getInstance().findFileByUrl(url); if (file != null) { + VcsDirtyScopeManager dirtyScopeManager = VcsDirtyScopeManager.getInstance(myVcs.getProject()); + if (recursive && file.isDirectory()) { - VcsDirtyScopeManager.getInstance(myVcs.getProject()).dirDirtyRecursively(file, true); + dirtyScopeManager.dirDirtyRecursively(file); } else { - VcsDirtyScopeManager.getInstance(myVcs.getProject()).fileDirty(file); + dirtyScopeManager.fileDirty(file); } } } @@ -272,8 +277,7 @@ public class PropertiesComponent extends JPanel { if (!StringUtil.isEmpty(property)) { try { myVcs.getFactory(myFile).createPropertyClient() - .setProperty(myFile, property, value != null ? SVNPropertyValue.create(value) : null, - Depth.allOrEmpty(recursive), force); + .setProperty(myFile, property, PropertyValue.create(value), Depth.allOrEmpty(recursive), force); } catch (VcsException error) { VcsBalloonProblemNotifier @@ -302,7 +306,7 @@ public class PropertiesComponent extends JPanel { public void actionPerformed(AnActionEvent e) { Project project = CommonDataKeys.PROJECT.getData(e.getDataContext()); - SVNPropertyData propValue = null; + PropertyValue propValue = null; try { propValue = myVcs.getFactory(myFile).createPropertyClient() .getProperty(SvnTarget.fromFile(myFile), SVNProperty.KEYWORDS, false, SVNRevision.WORKING); @@ -311,8 +315,7 @@ public class PropertiesComponent extends JPanel { // show erorr message } - SetKeywordsDialog dialog = new SetKeywordsDialog(project, - propValue != null ? SVNPropertyValue.getPropertyAsString(propValue.getValue()) : null); + SetKeywordsDialog dialog = new SetKeywordsDialog(project, PropertyValue.toString(propValue)); dialog.show(); if (dialog.isOK()) { setProperty(SvnPropertyKeys.SVN_KEYWORDS, dialog.getKeywords(), false, false); |