I was thinking that a big advantage of an automatically reproducible
bug would be an automatic svn/git-bisect to identify exactly where the
regression occurred.

I have attached do_bisect.sh and do_bisect_nosvn.sh. I'll mention that
these are only proof-of-concepts, are not ready for real use, and will
need to be rewritten before I submit them.

On Sat, Jul 11, 2009 at 4:37 PM, John McCabe-Dansted <gma...@gmail.com> wrote:
> $ cat TestSelectInset.kt
> KEYCODE="\Ca\[BackSpace]\Cmasdf\[Right]\D9\S\[Left]\D9X\Cs\D9"
> TEST="! grep asdf $F.lyx"
> DESC="r30414 unselects insets after a fraction of a second. 1.5.7 doesn't 
> exhibit this bug"

I used do_bisect.sh to determine that this problem occurred between
lyx_1_...@27417 and branch_1_...@27418. This was a fairly large
revision, so I used do_bisect_nosvn to determine that replacing any
single file did not cause the bug to appear (or disappear), although
it could cause the build to fail, due to mismatch between tocString
and textString.

Thus I determined that the smallest change I could add to lyx-1.6.0 to
cause the bug to occur was regression.diff (attached). Inspecting this
diff I found that the cause was replacing some (but not all)
occurrences of textString with tocString.

I attach InsetMathHull.diff which replaces the remaining occurrences
of textString with tocString. This fixes the bug.

Attachment: do_bisect.sh
Description: Bourne shell script

Attachment: do_bisect_nosvn.sh
Description: Bourne shell script

Index: src/insets/InsetSpace.cpp
===================================================================
--- src/insets/InsetSpace.cpp	(revision 27417)
+++ src/insets/InsetSpace.cpp	(working copy)
@@ -617,7 +617,7 @@
 }
 
 
-void InsetSpace::textString(odocstream & os) const
+void InsetSpace::tocString(odocstream & os) const
 {
 	plaintext(os, OutputParams(0));
 }
Index: src/insets/InsetFlex.cpp
===================================================================
--- src/insets/InsetFlex.cpp	(revision 27417)
+++ src/insets/InsetFlex.cpp	(working copy)
@@ -108,7 +108,7 @@
 }
 
 
-void InsetFlex::textString(odocstream & os) const
+void InsetFlex::tocString(odocstream & os) const
 {
 	os << text().asString(0, 1, AS_STR_LABEL | AS_STR_INSETS);
 }
Index: src/insets/InsetQuotes.h
===================================================================
--- src/insets/InsetQuotes.h	(revision 27417)
+++ src/insets/InsetQuotes.h	(working copy)
@@ -85,7 +85,7 @@
 	int docbook(odocstream &, OutputParams const &) const;
 
 	/// the string that is passed to the TOC
-	void textString(odocstream &) const;
+	void tocString(odocstream &) const;
 
 	///
 	void validate(LaTeXFeatures &) const;
Index: src/insets/InsetBranch.cpp
===================================================================
--- src/insets/InsetBranch.cpp	(revision 27417)
+++ src/insets/InsetBranch.cpp	(working copy)
@@ -232,7 +232,7 @@
 }
 
 
-void InsetBranch::textString(odocstream & os) const
+void InsetBranch::tocString(odocstream & os) const
 {
 	if (isBranchSelected())
 		os << text().asString(0, 1, AS_STR_LABEL | AS_STR_INSETS);
Index: src/insets/InsetSpace.h
===================================================================
--- src/insets/InsetSpace.h	(revision 27417)
+++ src/insets/InsetSpace.h	(working copy)
@@ -117,7 +117,7 @@
 	///
 	int docbook(odocstream &, OutputParams const &) const;
 	/// the string that is passed to the TOC
-	void textString(odocstream &) const;
+	void tocString(odocstream &) const;
 	///
 	void edit(Cursor & cur, bool front,
 		EntryDirection entry_from = ENTRY_DIRECTION_IGNORE);
Index: src/insets/InsetHyperlink.cpp
===================================================================
--- src/insets/InsetHyperlink.cpp	(revision 27417)
+++ src/insets/InsetHyperlink.cpp	(working copy)
@@ -165,7 +165,7 @@
 }
 
 
-void InsetHyperlink::textString(odocstream & os) const
+void InsetHyperlink::tocString(odocstream & os) const
 {
 	plaintext(os, OutputParams(0));
 }
Index: src/insets/InsetCitation.h
===================================================================
--- src/insets/InsetCitation.h	(revision 27417)
+++ src/insets/InsetCitation.h	(working copy)
@@ -48,7 +48,7 @@
 	///
 	int docbook(odocstream &, OutputParams const &) const;
 	/// the string that is passed to the TOC
-	void textString(odocstream &) const;
+	void tocString(odocstream &) const;
 	///
 	void validate(LaTeXFeatures &) const;
 	///
Index: src/insets/InsetQuotes.cpp
===================================================================
--- src/insets/InsetQuotes.cpp	(revision 27417)
+++ src/insets/InsetQuotes.cpp	(working copy)
@@ -312,7 +312,7 @@
 }
 
 
-void InsetQuotes::textString(odocstream & os) const
+void InsetQuotes::tocString(odocstream & os) const
 {
 	os << displayString();
 }
Index: src/insets/Inset.h
===================================================================
--- src/insets/Inset.h	(revision 27417)
+++ src/insets/Inset.h	(working copy)
@@ -292,7 +292,7 @@
 	/// docbook output
 	virtual int docbook(odocstream & os, OutputParams const &) const;
 	/// the string that is passed to the TOC
-	virtual void textString(odocstream &) const {}
+	virtual void tocString(odocstream &) const {}
 
 	/** This enum indicates by which means the inset can be modified:
 	- NOT_EDITABLE: the inset's content cannot be modified at all
Index: src/insets/InsetBranch.h
===================================================================
--- src/insets/InsetBranch.h	(revision 27417)
+++ src/insets/InsetBranch.h	(working copy)
@@ -74,7 +74,7 @@
 	///
 	int docbook(odocstream &, OutputParams const &) const;
 	///
-	void textString(odocstream &) const;
+	void tocString(odocstream &) const;
 	///
 	void validate(LaTeXFeatures &) const;
 	///
Index: src/insets/InsetCitation.cpp
===================================================================
--- src/insets/InsetCitation.cpp	(revision 27417)
+++ src/insets/InsetCitation.cpp	(working copy)
@@ -471,7 +471,7 @@
 }
 
 
-void InsetCitation::textString(odocstream & os) const
+void InsetCitation::tocString(odocstream & os) const
 {
 	plaintext(os, OutputParams(0));
 }
Index: src/insets/InsetHyperlink.h
===================================================================
--- src/insets/InsetHyperlink.h	(revision 27417)
+++ src/insets/InsetHyperlink.h	(working copy)
@@ -41,7 +41,7 @@
 	///
 	int docbook(odocstream &, OutputParams const &) const;
 	/// the string that is passed to the TOC
-	void textString(odocstream &) const;
+	void tocString(odocstream &) const;
 	///
 	static ParamInfo const & findInfo(std::string const &);
 	///
Index: src/insets/InsetRef.h
===================================================================
--- src/insets/InsetRef.h	(revision 27417)
+++ src/insets/InsetRef.h	(working copy)
@@ -55,7 +55,7 @@
 	///
 	int docbook(odocstream &, OutputParams const &) const;
 	/// the string that is passed to the TOC
-	void textString(odocstream &) const;
+	void tocString(odocstream &) const;
 	///
 	void validate(LaTeXFeatures & features) const;
 	///
Index: src/insets/InsetSpecialChar.h
===================================================================
--- src/insets/InsetSpecialChar.h	(revision 27417)
+++ src/insets/InsetSpecialChar.h	(working copy)
@@ -65,7 +65,7 @@
 	///
 	int docbook(odocstream &, OutputParams const &) const;
 	/// the string that is passed to the TOC
-	void textString(odocstream &) const;
+	void tocString(odocstream &) const;
 	///
 	InsetCode lyxCode() const { return SPECIALCHAR_CODE; }
 	/// We don't need \begin_inset and \end_inset
Index: src/insets/InsetFlex.h
===================================================================
--- src/insets/InsetFlex.h	(revision 27417)
+++ src/insets/InsetFlex.h	(working copy)
@@ -41,7 +41,7 @@
 	///
 	int docbook(odocstream &, OutputParams const &) const;
 	/// the string that is passed to the TOC
-	void textString(odocstream &) const;
+	void tocString(odocstream &) const;
 
 	/// should paragraph indendation be ommitted in any case?
 	bool neverIndent() const { return true; }
Index: src/insets/InsetRef.cpp
===================================================================
--- src/insets/InsetRef.cpp	(revision 27417)
+++ src/insets/InsetRef.cpp	(working copy)
@@ -115,7 +115,7 @@
 }
 
 
-void InsetRef::textString(odocstream & os) const
+void InsetRef::tocString(odocstream & os) const
 {
 	plaintext(os, OutputParams(0));
 }
Index: src/insets/InsetSpecialChar.cpp
===================================================================
--- src/insets/InsetSpecialChar.cpp	(revision 27417)
+++ src/insets/InsetSpecialChar.cpp	(working copy)
@@ -287,7 +287,7 @@
 }
 
 
-void InsetSpecialChar::textString(odocstream & os) const
+void InsetSpecialChar::tocString(odocstream & os) const
 {
 	plaintext(os, OutputParams(0));
 }
Index: src/Paragraph.cpp
===================================================================
--- src/Paragraph.cpp	(revision 27417)
+++ src/Paragraph.cpp	(working copy)
@@ -2431,7 +2431,7 @@
 		    || (c == '\n' && options & AS_STR_NEWLINES))
 			os.put(c);
 		else if (c == META_INSET && options & AS_STR_INSETS)
-			getInset(i)->textString(os);
+			getInset(i)->tocString(os);
 	}
 
 	return os.str();
Index: InsetMathHull.cpp
===================================================================
--- InsetMathHull.cpp	(revision 30495)
+++ InsetMathHull.cpp	(working copy)
@@ -1677,7 +1677,7 @@
 }
 
 
-void InsetMathHull::textString(odocstream & os) const
+void InsetMathHull::tocString(odocstream & os) const
 {
 	plaintext(os, OutputParams(0));
 }
Index: InsetMathHull.h
===================================================================
--- InsetMathHull.h	(revision 30495)
+++ InsetMathHull.h	(working copy)
@@ -119,7 +119,7 @@
 	///
 	int docbook(odocstream &, OutputParams const &) const;
 	/// the string that is passed to the TOC
-	void textString(odocstream &) const;
+	void tocString(odocstream &) const;
 
 	/// get notification when the cursor leaves this inset
 	bool notifyCursorLeaves(Cursor const & old, Cursor & cur);

Reply via email to