File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414 */
1515
1616using Hpdi . VssLogicalLib ;
17+ using System . Collections . Generic ;
18+ using System . IO ;
1719
1820namespace Hpdi . Vss2Git
1921{
@@ -52,14 +54,38 @@ public static RecursionStatus RecurseItems(
5254 return status ;
5355 }
5456 }
57+
58+ HashSet < string > locallyProcessedFiles = new HashSet < string > ( ) ;
5559 foreach ( VssFile file in project . Files )
5660 {
5761 RecursionStatus status = fileCallback ( project , file ) ;
62+ locallyProcessedFiles . Add ( file . PhysicalName ) ;
5863 if ( status == RecursionStatus . Abort )
5964 {
6065 return status ;
6166 }
6267 }
68+ foreach ( VssRevision revision in project . Revisions )
69+ {
70+ var namedAction = revision . Action as VssNamedAction ;
71+ if ( namedAction != null && ! namedAction . Name . IsProject )
72+ {
73+ string physicalName = namedAction . Name . PhysicalName ;
74+ if ( ! locallyProcessedFiles . Contains ( physicalName ) )
75+ {
76+ VssFile file = project . GetHistoricalFile ( physicalName , namedAction . Name . LogicalName ) ;
77+ locallyProcessedFiles . Add ( file . PhysicalName ) ;
78+ if ( File . Exists ( file . PhysicalPath ) && File . Exists ( file . DataPath ) )
79+ {
80+ RecursionStatus status = fileCallback ( project , file ) ;
81+ if ( status == RecursionStatus . Abort )
82+ {
83+ return status ;
84+ }
85+ }
86+ }
87+ }
88+ }
6389 return RecursionStatus . Continue ;
6490 }
6591 }
Original file line number Diff line number Diff line change @@ -48,6 +48,11 @@ public IEnumerable<VssFile> Files
4848 get { return new VssRevisions < VssProject , VssProjectRevision > ( this ) ; }
4949 }
5050
51+ public VssFile GetHistoricalFile ( string physicalName , string logicalName )
52+ {
53+ return database . OpenFile ( physicalName , logicalName ) ;
54+ }
55+
5156 public new VssProjectRevision GetRevision ( int version )
5257 {
5358 return ( VssProjectRevision ) base . GetRevision ( version ) ;
You can’t perform that action at this time.
0 commit comments