Lines 52-57
Link Here
|
52 |
import org.netbeans.modules.mercurial.HgFileNode; |
52 |
import org.netbeans.modules.mercurial.HgFileNode; |
53 |
import org.netbeans.modules.mercurial.HgModuleConfig; |
53 |
import org.netbeans.modules.mercurial.HgModuleConfig; |
54 |
import org.netbeans.modules.mercurial.ui.actions.ContextAction; |
54 |
import org.netbeans.modules.mercurial.ui.actions.ContextAction; |
|
|
55 |
import org.netbeans.modules.mercurial.ui.status.StatusAction; |
55 |
import org.netbeans.modules.mercurial.util.HgUtils; |
56 |
import org.netbeans.modules.mercurial.util.HgUtils; |
56 |
import org.netbeans.modules.mercurial.util.HgRepositoryContextCache; |
57 |
import org.netbeans.modules.mercurial.util.HgRepositoryContextCache; |
57 |
import org.netbeans.modules.mercurial.util.HgProjectUtils; |
58 |
import org.netbeans.modules.mercurial.util.HgProjectUtils; |
Lines 99-106
Link Here
|
99 |
} |
100 |
} |
100 |
|
101 |
|
101 |
public boolean isEnabled () { |
102 |
public boolean isEnabled () { |
102 |
FileStatusCache cache = Mercurial.getInstance().getFileStatusCache(); |
103 |
Set<File> ctxFiles = context != null? context.getRootFiles(): null; |
103 |
return cache.containsFileOfStatus(context, FileInformation.STATUS_LOCAL_CHANGE); |
104 |
if(HgUtils.getRootFile(context) == null || ctxFiles == null || ctxFiles. |
|
|
105 |
size() == 0) |
106 |
return false; |
107 |
return true; |
104 |
} |
108 |
} |
105 |
|
109 |
|
106 |
public void performAction(ActionEvent e) { |
110 |
public void performAction(ActionEvent e) { |
Lines 119-128
Link Here
|
119 |
JOptionPane.INFORMATION_MESSAGE); |
123 |
JOptionPane.INFORMATION_MESSAGE); |
120 |
return; |
124 |
return; |
121 |
} |
125 |
} |
|
|
126 |
RequestProcessor rp = Mercurial.getInstance().getRequestProcessor(root); |
127 |
final HgProgressSupport support = new HgProgressSupport() { |
128 |
Runnable doCommit = new Runnable () { |
129 |
public void run() { |
122 |
String contentTitle = Utils.getContextDisplayName(context); |
130 |
String contentTitle = Utils.getContextDisplayName(context); |
123 |
|
|
|
124 |
commit(contentTitle, context); |
131 |
commit(contentTitle, context); |
125 |
} |
132 |
} |
|
|
133 |
}; |
134 |
public void perform() { |
135 |
StatusAction.executeStatus(context, this); |
136 |
SwingUtilities.invokeLater(doCommit); |
137 |
} |
138 |
}; |
139 |
support.start(rp, root.getAbsolutePath(), org.openide.util.NbBundle.getMessage(CommitPanel.class, "LBL_Refresh_Progress")); // NOI18N; |
140 |
} |
126 |
|
141 |
|
127 |
public static void commit(String contentTitle, final VCSContext ctx) { |
142 |
public static void commit(String contentTitle, final VCSContext ctx) { |
128 |
FileStatusCache cache = Mercurial.getInstance().getFileStatusCache(); |
143 |
FileStatusCache cache = Mercurial.getInstance().getFileStatusCache(); |