diff src/com/tmate/hgkit/console/Log.java @ 6:5abe5af181bd

Ant script to build commands and run sample
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Wed, 22 Dec 2010 03:33:37 +0100
parents aa1912c70b36
children a78c980749e3
line wrap: on
line diff
--- a/src/com/tmate/hgkit/console/Log.java	Tue Dec 21 05:11:06 2010 +0100
+++ b/src/com/tmate/hgkit/console/Log.java	Wed Dec 22 03:33:37 2010 +0100
@@ -29,20 +29,21 @@
 				cset.dump();
 			}
 		};
-		for (String fname : cmdLineOpts.files) {
-			HgDataFile f1 = hgRepo.getFileNode(fname);
-			System.out.println("\nComplete of a file: " + fname);
-			f1.history(callback);
+		if (cmdLineOpts.files.isEmpty()) {
+			System.out.println("Complete history of the repo:");
+			hgRepo.getChangelog().all(callback);
+		} else {
+			for (String fname : cmdLineOpts.files) {
+				HgDataFile f1 = hgRepo.getFileNode(fname);
+				System.out.println("History of the file: " + fname);
+				f1.history(callback);
+			}
+		}
 		//
 //		System.out.println("\n\n=========================");
 //		System.out.println("Range 1-3:");
 //		f1.history(1,3, callback);
-		}
 		//
-		System.out.println("\n\n=========================");
-		System.out.println("Complete of a repo:");
-		hgRepo.getChangelog().all(callback);
 		//new ChangelogWalker().setFile("hello.c").setRevisionRange(1, 4).accept(new Visitor);
 	}
-
 }