changeset 688:1499139a600a

Defect: copies are not reported with default settings (not even as added!). Parameter needCopies removed as there seems to be no reason to condition copies for hi-level api (HgStatus.isCopy() is way down the road)
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Sat, 27 Jul 2013 20:15:37 +0200
parents 9859fcea475d
children 5050ee565bd1
files cmdline/org/tmatesoft/hg/console/Status.java src/org/tmatesoft/hg/core/HgStatusCommand.java
diffstat 2 files changed, 6 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/cmdline/org/tmatesoft/hg/console/Status.java	Sat Jul 27 18:34:14 2013 +0200
+++ b/cmdline/org/tmatesoft/hg/console/Status.java	Sat Jul 27 20:15:37 2013 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010-2011 TMate Software Ltd
+ * Copyright (c) 2010-2013 TMate Software Ltd
  *  
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -44,7 +44,7 @@
 public class Status {
 
 	public static void main(String[] args) throws Exception {
-		final Set<String> flagOpts = asSet("-A", "-all", "-m", "--modified", "-a", "--added", "-r", "--removed", 
+		final Set<String> flagOpts = asSet("-A", "--all", "-m", "--modified", "-a", "--added", "-r", "--removed", 
 				"--d", "--deleted", "-u", "--unknown", "-c", "--clean", "-i", "--ignored",
 				"-n", "--no-status", "-C", "--copies");
 		Options cmdLineOpts = Options.parse(args, flagOpts);
--- a/src/org/tmatesoft/hg/core/HgStatusCommand.java	Sat Jul 27 18:34:14 2013 +0200
+++ b/src/org/tmatesoft/hg/core/HgStatusCommand.java	Sat Jul 27 20:15:37 2013 +0200
@@ -61,13 +61,13 @@
 	public HgStatusCommand defaults() {
 		final Mediator m = mediator;
 		m.needModified = m.needAdded = m.needRemoved = m.needUnknown = m.needMissing = true;
-		m.needCopies = m.needClean = m.needIgnored = false;
+		m.needClean = m.needIgnored = false;
 		return this;
 	}
 	public HgStatusCommand all() {
 		final Mediator m = mediator;
 		m.needModified = m.needAdded = m.needRemoved = m.needUnknown = m.needMissing = true;
-		m.needCopies = m.needClean = m.needIgnored = true;
+		m.needClean = m.needIgnored = true;
 		return this;
 	}
 	
@@ -252,7 +252,6 @@
 		boolean needMissing;
 		boolean needClean;
 		boolean needIgnored;
-		boolean needCopies;
 		HgStatusHandler handler;
 		private ChangelogHelper logHelper;
 		private HgCallbackTargetException failure;
@@ -311,10 +310,8 @@
 			}
 		}
 		public void copied(Path fnameOrigin, Path fnameAdded) {
-			if (needCopies) {
-				// TODO post-1.0 in fact, merged files may report 'copied from' as well, correct status kind thus may differ from Added
-				dispatch(new HgStatus(Added, fnameAdded, fnameOrigin, logHelper));
-			}
+			// TODO post-1.0 in fact, merged files may report 'copied from' as well, correct status kind thus may differ from Added
+			dispatch(new HgStatus(Added, fnameAdded, fnameOrigin, logHelper));
 		}
 		public void missing(Path fname) {
 			if (needMissing) {