Lines 42-47
package org.netbeans.modules.mercurial.u
Link Here
|
42 |
package org.netbeans.modules.mercurial.util; |
42 |
package org.netbeans.modules.mercurial.util; |
43 |
|
43 |
|
44 |
import java.awt.EventQueue; |
44 |
import java.awt.EventQueue; |
|
|
45 |
import javax.swing.JOptionPane; |
45 |
import java.io.BufferedReader; |
46 |
import java.io.BufferedReader; |
46 |
import java.io.BufferedWriter; |
47 |
import java.io.BufferedWriter; |
47 |
import java.io.FileWriter; |
48 |
import java.io.FileWriter; |
Lines 1670-1677
public class HgCommand {
Link Here
|
1670 |
command.add(HG_COMMIT_OPT_LOGFILE_CMD); |
1671 |
command.add(HG_COMMIT_OPT_LOGFILE_CMD); |
1671 |
command.add(tempfile.getAbsolutePath()); |
1672 |
command.add(tempfile.getAbsolutePath()); |
1672 |
|
1673 |
|
|
|
1674 |
List<String> saveCommand = null; |
1675 |
if(Utilities.isWindows()) { |
1676 |
saveCommand = new ArrayList<String>(command); |
1677 |
} |
1673 |
for(File f: commitFiles){ |
1678 |
for(File f: commitFiles){ |
1674 |
command.add(f.getAbsolutePath().substring(repository.getAbsolutePath().length()+1)); |
1679 |
command.add(f.getAbsolutePath().substring(repository.getAbsolutePath().length()+1)); |
|
|
1680 |
} |
1681 |
if(Utilities.isWindows()) { |
1682 |
// Count size of command |
1683 |
int size = 0; |
1684 |
for (String line : command) { |
1685 |
size += line.length(); |
1686 |
} |
1687 |
int maxSize = 32767; // Assume CreateProcess is used |
1688 |
if (size > maxSize) { |
1689 |
NotifyDescriptor descriptor = new NotifyDescriptor.Confirmation(NbBundle.getMessage(HgCommand.class, "MSG_LONG_COMMAND_QUERY")); // NOI18N |
1690 |
descriptor.setTitle(NbBundle.getMessage(HgCommand.class, "MSG_LONG_COMMAND_TITLE")); // NOI18N |
1691 |
descriptor.setMessageType(JOptionPane.WARNING_MESSAGE); |
1692 |
descriptor.setOptionType(NotifyDescriptor.YES_NO_OPTION); |
1693 |
|
1694 |
Object res = DialogDisplayer.getDefault().notify(descriptor) |
1695 |
; |
1696 |
if (res == NotifyDescriptor.NO_OPTION) { |
1697 |
return; |
1698 |
} |
1699 |
command = saveCommand; |
1700 |
} |
1675 |
} |
1701 |
} |
1676 |
List<String> list = exec(command); |
1702 |
List<String> list = exec(command); |
1677 |
|
1703 |
|