Fossil SCM

This commit starts a series of incremental changes not quite completely overhauling the handling of changesets, i.e. of project-level revisions. Actually this series of changes already started with [8ce7ffff21] as the bug it fixes was found when the first parts of the overhaul tripped the new integrity conditions for the modified changesets. Background: In the last few days I repeatedly ran against the wall of an assertion in pass 9, last of the cycle breakers, with the revision changesets coming in out of order when the symbols were added to the dependency graph. While walking to the office, and later re-reading the relevant parts of cvs2svn again I had several insights. Trigger was the realization that giving the tag changesets successor dependencies was wrong. Tags describe a state, they have no successors. This caused the re-read, and I recognized that my handling of the symbol changesets was completely wrong, that with using revisions as their data. It should have been the tags and branches. From there their actual dependencies (versus my reuse of revision dependencies) fell out naturally. I have decided to commit my rewrite of the internals incrementally to make it easier to follow them, despite leaving the sourcebase in an unusable state during the series. One big commit would be much more difficult to understand. The central change is to the changeset class, which becomes a trinity, holding either revisions, tags, or branches, with type-dependent code to retrieve their dependencies. The remainder of the changes are 'just' adaptions of the users to the changed API. First change: Add outline of the helper classes, singletons actually, to hold the type-dependent functionality.

aku 2007-11-29 05:58 trunk
Commit 27b15b7095e1c53df376e85a86f6348421bd31a0
--- tools/cvs2fossil/lib/c2f_prev.tcl
+++ tools/cvs2fossil/lib/c2f_prev.tcl
@@ -842,10 +842,90 @@
842842
pragma -hasinfo no ; # no object introspection
843843
pragma -simpledispatch yes ; # simple fast dispatch
844844
845845
# # ## ### ##### ######## #############
846846
}
847
+
848
+# # ## ### ##### ######## ############# #####################
849
+## Helper singleton. Commands for revision changesets.
850
+
851
+snit::type ::vc::fossil::import::cvs::project::rev::rev {
852
+ typemethod byrevision {} { return 1 }
853
+ typemethod bysymbol {} { return 0 }
854
+ typemethod istag {} { return 0 }
855
+ typemethod isbranch {} { return 0 }
856
+
857
+ # result = list (mintime, maxtime)
858
+ typemethod timerange {items} {
859
+ }
860
+
861
+ # var(dv) = dict (revision -> list (revision))
862
+ typemethod internalsuccessors {dv revisions} {
863
+ }
864
+
865
+ # var(dv) = dict (item -> list (item)), item = list (type id)
866
+ typemethod successors {dv revisions} {
867
+ }
868
+
869
+ # var(dv) = dict (item -> list (item)), item = list (type id)
870
+ typemethod predecessors {dv revisions} {
871
+ }
872
+}
873
+
874
+# # ## ### ##### ######## ############# #####################
875
+## Helper singleton. Commands for tag symbol changesets.
876
+
877
+snit::type ::vc::fossil::import::cvs::project::rev::sym::tag {
878
+ typemethod byrevision {} { return 0 }
879
+ typemethod bysymbol {} { return 1 }
880
+ typemethod istag {} { return 1 }
881
+ typemethod isbranch {} { return 0 }
882
+
883
+ # result = list (mintime, maxtime)
884
+ typemethod timerange {tags} {
885
+ }
886
+
887
+ # var(dv) = dict (item -> list (item)), item = list (type id)
888
+ typemethod successors {dv tags} {
889
+ }
890
+
891
+ # var(dv) = dict (item -> list (item)), item = list (type id)
892
+ typemethod predecessors {dv tags} {
893
+ }
894
+}
895
+
896
+# # ## ### ##### ######## ############# #####################
897
+## Helper singleton. Commands for branch symbol changesets.
898
+
899
+snit::type ::vc::fossil::import::cvs::project::rev::sym::branch {
900
+ typemethod byrevision {} { return 0 }
901
+ typemethod bysymbol {} { return 1 }
902
+ typemethod istag {} { return 0 }
903
+ typemethod isbranch {} { return 1 }
904
+
905
+ # result = list (mintime, maxtime)
906
+ typemethod timerange {branches} {
907
+ }
908
+
909
+ # var(dv) = dict (item -> list (item)), item = list (type id)
910
+ typemethod successors {dv branches} {
911
+ }
912
+
913
+ # var(dv) = dict (item -> list (item)), item = list (type id)
914
+ typemethod predecessors {dv branches} {
915
+ }
916
+
917
+ # # ## ### ##### ######## #############
918
+ ## Configuration
919
+
920
+ pragma -hasinstances no ; # singleton
921
+ pragma -hastypeinfo no ; # no introspection
922
+ pragma -hastypedestroy no ; # immortal
923
+}
924
+
925
+# # ## ### ##### ######## ############# #####################
926
+##
847927
848928
namespace eval ::vc::fossil::import::cvs::project {
849929
namespace export rev
850930
namespace eval rev {
851931
namespace import ::vc::fossil::import::cvs::state
@@ -856,13 +936,27 @@
856936
::variable mybranchcode [project::sym branch]
857937
namespace import ::vc::tools::misc::*
858938
namespace import ::vc::tools::trouble
859939
namespace import ::vc::tools::log
860940
log register csets
941
+
942
+ # Set up the helper singletons
943
+ namespace eval rev {
944
+ namespace import ::vc::fossil::import::cvs::state
945
+ namespace import ::vc::fossil::import::cvs::integrity
946
+ }
947
+ namespace eval sym::tag {
948
+ namespace import ::vc::fossil::import::cvs::state
949
+ namespace import ::vc::fossil::import::cvs::integrity
950
+ }
951
+ namespace eval sym::branch {
952
+ namespace import ::vc::fossil::import::cvs::state
953
+ namespace import ::vc::fossil::import::cvs::integrity
954
+ }
861955
}
862956
}
863957
864958
# # ## ### ##### ######## ############# #####################
865959
## Ready
866960
867961
package provide vc::fossil::import::cvs::project::rev 1.0
868962
return
869963
--- tools/cvs2fossil/lib/c2f_prev.tcl
+++ tools/cvs2fossil/lib/c2f_prev.tcl
@@ -842,10 +842,90 @@
842 pragma -hasinfo no ; # no object introspection
843 pragma -simpledispatch yes ; # simple fast dispatch
844
845 # # ## ### ##### ######## #############
846 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
847
848 namespace eval ::vc::fossil::import::cvs::project {
849 namespace export rev
850 namespace eval rev {
851 namespace import ::vc::fossil::import::cvs::state
@@ -856,13 +936,27 @@
856 ::variable mybranchcode [project::sym branch]
857 namespace import ::vc::tools::misc::*
858 namespace import ::vc::tools::trouble
859 namespace import ::vc::tools::log
860 log register csets
 
 
 
 
 
 
 
 
 
 
 
 
 
 
861 }
862 }
863
864 # # ## ### ##### ######## ############# #####################
865 ## Ready
866
867 package provide vc::fossil::import::cvs::project::rev 1.0
868 return
869
--- tools/cvs2fossil/lib/c2f_prev.tcl
+++ tools/cvs2fossil/lib/c2f_prev.tcl
@@ -842,10 +842,90 @@
842 pragma -hasinfo no ; # no object introspection
843 pragma -simpledispatch yes ; # simple fast dispatch
844
845 # # ## ### ##### ######## #############
846 }
847
848 # # ## ### ##### ######## ############# #####################
849 ## Helper singleton. Commands for revision changesets.
850
851 snit::type ::vc::fossil::import::cvs::project::rev::rev {
852 typemethod byrevision {} { return 1 }
853 typemethod bysymbol {} { return 0 }
854 typemethod istag {} { return 0 }
855 typemethod isbranch {} { return 0 }
856
857 # result = list (mintime, maxtime)
858 typemethod timerange {items} {
859 }
860
861 # var(dv) = dict (revision -> list (revision))
862 typemethod internalsuccessors {dv revisions} {
863 }
864
865 # var(dv) = dict (item -> list (item)), item = list (type id)
866 typemethod successors {dv revisions} {
867 }
868
869 # var(dv) = dict (item -> list (item)), item = list (type id)
870 typemethod predecessors {dv revisions} {
871 }
872 }
873
874 # # ## ### ##### ######## ############# #####################
875 ## Helper singleton. Commands for tag symbol changesets.
876
877 snit::type ::vc::fossil::import::cvs::project::rev::sym::tag {
878 typemethod byrevision {} { return 0 }
879 typemethod bysymbol {} { return 1 }
880 typemethod istag {} { return 1 }
881 typemethod isbranch {} { return 0 }
882
883 # result = list (mintime, maxtime)
884 typemethod timerange {tags} {
885 }
886
887 # var(dv) = dict (item -> list (item)), item = list (type id)
888 typemethod successors {dv tags} {
889 }
890
891 # var(dv) = dict (item -> list (item)), item = list (type id)
892 typemethod predecessors {dv tags} {
893 }
894 }
895
896 # # ## ### ##### ######## ############# #####################
897 ## Helper singleton. Commands for branch symbol changesets.
898
899 snit::type ::vc::fossil::import::cvs::project::rev::sym::branch {
900 typemethod byrevision {} { return 0 }
901 typemethod bysymbol {} { return 1 }
902 typemethod istag {} { return 0 }
903 typemethod isbranch {} { return 1 }
904
905 # result = list (mintime, maxtime)
906 typemethod timerange {branches} {
907 }
908
909 # var(dv) = dict (item -> list (item)), item = list (type id)
910 typemethod successors {dv branches} {
911 }
912
913 # var(dv) = dict (item -> list (item)), item = list (type id)
914 typemethod predecessors {dv branches} {
915 }
916
917 # # ## ### ##### ######## #############
918 ## Configuration
919
920 pragma -hasinstances no ; # singleton
921 pragma -hastypeinfo no ; # no introspection
922 pragma -hastypedestroy no ; # immortal
923 }
924
925 # # ## ### ##### ######## ############# #####################
926 ##
927
928 namespace eval ::vc::fossil::import::cvs::project {
929 namespace export rev
930 namespace eval rev {
931 namespace import ::vc::fossil::import::cvs::state
@@ -856,13 +936,27 @@
936 ::variable mybranchcode [project::sym branch]
937 namespace import ::vc::tools::misc::*
938 namespace import ::vc::tools::trouble
939 namespace import ::vc::tools::log
940 log register csets
941
942 # Set up the helper singletons
943 namespace eval rev {
944 namespace import ::vc::fossil::import::cvs::state
945 namespace import ::vc::fossil::import::cvs::integrity
946 }
947 namespace eval sym::tag {
948 namespace import ::vc::fossil::import::cvs::state
949 namespace import ::vc::fossil::import::cvs::integrity
950 }
951 namespace eval sym::branch {
952 namespace import ::vc::fossil::import::cvs::state
953 namespace import ::vc::fossil::import::cvs::integrity
954 }
955 }
956 }
957
958 # # ## ### ##### ######## ############# #####################
959 ## Ready
960
961 package provide vc::fossil::import::cvs::project::rev 1.0
962 return
963

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button