diff src/org/tmatesoft/hg/repo/HgPhase.java @ 649:e79cf9a8130b

Push: phase4 - update local and remote phase information
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Wed, 26 Jun 2013 20:52:38 +0200
parents 5afc7eedb3dd
children cd77bf51b562
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/repo/HgPhase.java	Tue Jun 25 20:48:37 2013 +0200
+++ b/src/org/tmatesoft/hg/repo/HgPhase.java	Wed Jun 26 20:52:38 2013 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012 TMate Software Ltd
+ * Copyright (c) 2012-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
@@ -58,4 +58,14 @@
 		}
 		throw new IllegalArgumentException(String.format("Bad phase name: %d", value));
 	}
+	
+	/**
+	 * @return integer value Mercurial uses to identify the phase
+	 */
+	public int mercurialOrdinal() {
+		if (this == Undefined) {
+			throw new IllegalStateException("Undefined phase is an artifical value, which doesn't possess a valid native mercurial ordinal");
+		}
+		return ordinal(); // what a coincidence
+	}
 }