@@ -778,6 +778,70 @@ def test_iter_nodes(self):
778
778
(root_commit , 'B/b2.txt' ),
779
779
], [(node .created_rev , node .path ) for node in nodes ])
780
780
781
+ def test_colon_character_in_filename (self ):
782
+ self ._git_init (data = False )
783
+ self ._git_fast_import (self ._data_colon_character_in_filename )
784
+ self ._add_repository ('gitrepos' )
785
+ repos = self ._repomgr .get_repository ('gitrepos' )
786
+ repos .sync ()
787
+ rev1 = '382e1e6b85ba20ce8a84af1a875eaa50b8e1e092' # root commit
788
+ rev2 = 'd8001832aad079f85a39a54a388a8b15fe31093d'
789
+ ADD = Changeset .ADD
790
+ MOVE = Changeset .MOVE
791
+ FILE = Node .FILE
792
+
793
+ cset = repos .get_changeset (rev1 )
794
+ self .assertEqual (set ([('0100644' , FILE , ADD , None , None ),
795
+ ('0100644.txt' , FILE , ADD , None , None ),
796
+ (':100644' , FILE , ADD , None , None ),
797
+ (':100644.txt' , FILE , ADD , None , None ),
798
+ ('a100644' , FILE , ADD , None , None ),
799
+ ('a100644.txt' , FILE , ADD , None , None )
800
+ ]),
801
+ set (cset .get_changes ()))
802
+
803
+ cset = repos .get_changeset (rev2 )
804
+ self .assertEqual (set ([(':100666' , FILE , MOVE , ':100644' , rev1 )]),
805
+ set (cset .get_changes ()))
806
+
807
+ _data_colon_character_in_filename = """\
808
+ blob
809
+ mark :1
810
+ data 0
811
+
812
+ blob
813
+ mark :2
814
+ data 16
815
+ ...............
816
+
817
+ reset refs/heads/master
818
+ commit refs/heads/master
819
+ mark :3
820
+ author Joe <[email protected] > 1491387182 +0000
821
+ committer Joe <[email protected] > 1491387182 +0000
822
+ data 9
823
+ (#12758)
824
+ M 100644 :1 0100644.txt
825
+ M 100644 :1 0100644
826
+ M 100644 :1 :100644.txt
827
+ M 100644 :2 :100644
828
+ M 100644 :1 a100644.txt
829
+ M 100644 :1 a100644
830
+
831
+ commit refs/heads/master
832
+ mark :4
833
+ author Joe <[email protected] > 1491387183 +0000
834
+ committer Joe <[email protected] > 1491387183 +0000
835
+ data 16
836
+ (#12758) rename
837
+ from :3
838
+ D :100644
839
+ M 100644 :2 :100666
840
+
841
+ reset refs/heads/master
842
+ from :4
843
+ """
844
+
781
845
def _get_quickjump_names (self , repos ):
782
846
return list (name for type , name , path , rev
783
847
in repos .get_quickjump_entries ('HEAD' ))
0 commit comments