On 2 Dec 2009, 22:23, Mike Sokolsky <[email protected]> wrote:
> As a followup to this, the fix for the qimport bug is to remove the "--name"
> from the command in HgQImportClient.
>
> I've found qpop does work, but like qpush relies on having a patch selected
> to pop to, it won't pop anything if no patch is selected. Both these
> behaviors seem very unintuitive at least to me.
>
> Another confusing issue with the UI is the statusLabel output. This only
> seems to be updated at the beginning, when the hg root changes, or when an
> exception occurs executing a command. Once the exception occurs the status
> continues to display the same message even after new, successfully commands
> are issued. Because it is limited to one line out output, if say qpush
> fails with invalid hunks the only feedback is the status bar now reads
> 'applying patchname'. The failed hunks are not applied, but hgqueues
> considers the patch itself to be applied - however populateTable is not
> called when an exception occurs, so until something else causes
> populateTable to be called the view is not update to reflect changes.
> Perhaps a dialog with the full message would be a more useful way to present
> errors here, and/or a patch status akin to FAILED or PARTIALLY APPLIED.
>
> As I get time I'm happy to work on a fix that would address some or all of
> these issues, but want to make sure there is interest in the changes first.
I have just started using Mercurial Eclipse and found out that the
patch queues does not work like they do on the command line, when it
comes to pushing and popping without specifying a patch. I
investigated
the issue and found some null-dereferencing errors. I fixed these and
verified that it works. However, I have no publicly available
repository
to pull from, so if someone would like to adopt this patch and mare
sure it comes in nicely?
# HG changeset patch
# User Thorbjorn Jemander
# Date 1262816726 -3600
# Node ID 694cb65b47d0e265b214a0c7750fe0a25f32ef87
# Parent 600d35f053535596b8670373ba9911a7423d6aa3
Fixed null-dereferencing in qpop and qpush, corrected an error in
Table selection management, and thus provided the command line
behaviour for qpop, qpush when there are no selections in the patch
queue table.
diff -r 600d35f05353 -r 694cb65b47d0 src/com/vectrace/MercurialEclipse/
commands/extensions/mq/HgQPopClient.java
--- a/src/com/vectrace/MercurialEclipse/commands/extensions/mq/
HgQPopClient.javaMon Jan 04 13:03:10 2010 -0500
+++ b/src/com/vectrace/MercurialEclipse/commands/extensions/mq/
HgQPopClient.javaWed Jan 06 23:25:26 2010 +0100
@@ -49,7 +49,9 @@
command.addOptions("--force"); //$NON-NLS-1$
}
- command.addOptions(patchName);
+ if (patchName != "") {
+ command.addOptions(patchName);
+ }
return command.executeToString();
}
}
diff -r 600d35f05353 -r 694cb65b47d0 src/com/vectrace/MercurialEclipse/
commands/extensions/mq/HgQPushClient.java
--- a/src/com/vectrace/MercurialEclipse/commands/extensions/mq/
HgQPushClient.java Mon Jan 04 13:03:10 2010 -0500
+++ b/src/com/vectrace/MercurialEclipse/commands/extensions/mq/
HgQPushClient.java Wed Jan 06 23:25:26 2010 +0100
@@ -46,8 +46,9 @@
if (force) {
command.addOptions("--force"); //$NON-NLS-1$
}
-
- command.addOptions(patchName);
+ if (patchName != "") {
+ command.addOptions(patchName);
+ }
return command.executeToString();
}
}
diff -r 600d35f05353 -r 694cb65b47d0 src/com/vectrace/MercurialEclipse/
ui/PatchTable.java
--- a/src/com/vectrace/MercurialEclipse/ui/PatchTable.java Mon Jan 04
13:03:10 2010 -0500
+++ b/src/com/vectrace/MercurialEclipse/ui/PatchTable.java Wed Jan 06
23:25:26 2010 +0100
@@ -90,7 +90,7 @@
public Patch getSelection() {
List<Patch>list = getSelections();
- if (list.size()==0) {
+ if (list == null || list.size()==0) {
return null;
}
return list.get(0);
diff -r 600d35f05353 -r 694cb65b47d0 src/com/vectrace/MercurialEclipse/
views/PatchQueueView.java
--- a/src/com/vectrace/MercurialEclipse/views/PatchQueueView.java Mon
Jan 04 13:03:10 2010 -0500
+++ b/src/com/vectrace/MercurialEclipse/views/PatchQueueView.java Wed
Jan 06 23:25:26 2010 +0100
@@ -139,9 +139,13 @@
@Override
public void run() {
try {
- HgQPushClient.push(resource, false,
table
- .getSelection()
- .getName());
+ Patch patch = table.getSelection();
+ if (patch != null) {
+ HgQPushClient.push(resource,
false, patch.getName());
+ } else {
+ HgQPushClient.push(resource,
false, "");
+ }
+
populateTable();
resource.refreshLocal(IResource.DEPTH_INFINITE,
new
NullProgressMonitor());
@@ -157,9 +161,12 @@
@Override
public void run() {
try {
- HgQPopClient.pop(resource, false, table
- .getSelection()
- .getName());
+ Patch patch = table.getSelection();
+ if (patch != null) {
+ HgQPopClient.pop(resource,
false, patch.getName());
+ } else {
+ HgQPopClient.pop(resource,
false, "");
+ }
populateTable();
resource.refreshLocal(IResource.DEPTH_INFINITE,
new
NullProgressMonitor());
--
You received this message because you are subscribed to the Google Groups
"MercurialEclipse" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/mercurialeclipse?hl=en.