]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiCompareHistory.cpp
rename buffer parameter math_number_before to math_numbering_side
[lyx.git] / src / frontends / qt4 / GuiCompareHistory.cpp
index a659629938937334f7aaca25358b3dca8ac58d77..d176a387c41c0eda881975cc02a6a9dcfe979289 100644 (file)
@@ -9,6 +9,8 @@
  */
 
 #include <config.h>
+#include <support/debug.h>
+#include <limits>
 
 #include "GuiCompareHistory.h"
 
@@ -50,11 +52,22 @@ bool GuiCompareHistory::initialiseParams(std::string const &)
        int rev=0;
 
        string tmp;
-       // RCS case
-       if (!isStrInt(revstring))
-               revstring = rsplit(revstring, tmp , '.' );
-       if (isStrInt(revstring))
-               rev = convert<int>(revstring);
+       bool enableBetween = true;
+       // GIT case, hash is long
+       if (revstring.length() > 20) {
+               enableBetween = false;
+               rev = numeric_limits<int>::max();
+       } else {
+               // RCS case
+               if (!isStrInt(revstring))
+                       revstring = rsplit(revstring, tmp , '.' );
+               // both SVN & RCS cases
+               if (isStrInt(revstring))
+                       rev = convert<int>(revstring);
+       }
+
+       // later we can provide comparison between two hashes
+       betweenrevRB->setEnabled(enableBetween);
 
        okPB->setEnabled(rev);
        rev1SB->setMaximum(rev);