# HG changeset patch # User padraigob@netbeans.org # Date 1211799595 -3600 # Node ID 53cdad22ad81d296a82f32aabb80f85c1b11df08 # Parent 2c81b54b4b60bfd990d187a663fa8fab619c5d8a 134937: Fire status change event for files updated after push diff -r 2c81b54b4b60 -r 53cdad22ad81 mercurial/src/org/netbeans/modules/mercurial/FileStatusCache.java --- a/mercurial/src/org/netbeans/modules/mercurial/FileStatusCache.java Sat May 24 11:36:07 2008 +0400 +++ b/mercurial/src/org/netbeans/modules/mercurial/FileStatusCache.java Mon May 26 11:59:55 2008 +0100 @@ -866,6 +866,10 @@ public class FileStatusCache { listenerSupport.firePropertyChange(PROP_FILE_STATUS_CHANGED, null, new ChangedEvent(file, oldInfo, newInfo)); } + public void notifyFileChanged(File file) { + fireFileStatusChanged(file, null, FILE_INFORMATION_UPTODATE); + } + public void refreshDirtyFileSystems() { Set filesystems = getFilesystemsToRefresh(); FileSystem[] filesystemsToRefresh = new FileSystem[filesystems.size()]; diff -r 2c81b54b4b60 -r 53cdad22ad81 mercurial/src/org/netbeans/modules/mercurial/Mercurial.java --- a/mercurial/src/org/netbeans/modules/mercurial/Mercurial.java Sat May 24 11:36:07 2008 +0400 +++ b/mercurial/src/org/netbeans/modules/mercurial/Mercurial.java Mon May 26 11:59:55 2008 +0100 @@ -405,6 +405,10 @@ public class Mercurial { } } + public void notifyFileChanged(File file) { + fileStatusCache.notifyFileChanged(file); + } + /** * * @param repositoryRoot String of Mercurial repository so that logger writes to correct output tab. Can be null diff -r 2c81b54b4b60 -r 53cdad22ad81 mercurial/src/org/netbeans/modules/mercurial/ui/push/PushAction.java --- a/mercurial/src/org/netbeans/modules/mercurial/ui/push/PushAction.java Sat May 24 11:36:07 2008 +0400 +++ b/mercurial/src/org/netbeans/modules/mercurial/ui/push/PushAction.java Mon May 26 11:59:55 2008 +0100 @@ -123,6 +123,21 @@ public class PushAction extends ContextA } + private static void notifyUpdatedFiles(File pushFile, List list){ + // When hg output -v is called the output is + // resolving manifests + // getting file + // ... + // + for (String line : list) { + if (line.startsWith("getting ")) { + String name = line.substring(8); + File file = new File (pushFile, name); + Mercurial.getInstance().notifyFileChanged(file); + } + } + } + static void getDefaultAndPerformPush(VCSContext ctx, File root, OutputLogger logger) { // If the repository has no default pull path then inform user String tmpPushPath = HgRepositoryContextCache.getPushDefault(ctx); @@ -258,6 +273,8 @@ public class PushAction extends ContextA boolean bOutStandingUncommittedMerges = HgCommand.isMergeAbortUncommittedMsg(list.get(list.size() - 1)); if (bOutStandingUncommittedMerges) { bConfirmMerge = HgUtils.confirmDialog(PushAction.class, "MSG_PUSH_MERGE_CONFIRM_TITLE", "MSG_PUSH_MERGE_UNCOMMITTED_CONFIRM_QUERY"); // NOI18N + } else { + notifyUpdatedFiles(pushFile, list); } } } else { diff -r 2c81b54b4b60 -r 53cdad22ad81 mercurial/src/org/netbeans/modules/mercurial/util/HgCommand.java --- a/mercurial/src/org/netbeans/modules/mercurial/util/HgCommand.java Sat May 24 11:36:07 2008 +0400 +++ b/mercurial/src/org/netbeans/modules/mercurial/util/HgCommand.java Mon May 26 11:59:55 2008 +0100 @@ -339,6 +339,7 @@ public class HgCommand { command.add(getHgCommand()); command.add(HG_UPDATE_ALL_CMD); + command.add(HG_VERBOSE_CMD); if (bForce) command.add(HG_UPDATE_FORCE_ALL_CMD); command.add(HG_OPT_REPOSITORY); command.add(repository.getAbsolutePath());