View unanswered posts | View active topics



Reply to topic  [ 41 posts ]  Go to page 1, 2, 3  Next
[FD4] Team Foundation Server plugin 
Author Message
Member

Joined: Sat Jun 26, 2010 7:29 pm
Posts: 25
Location: Feldkirch, Austria
Description:
This plugin basically is a copy of the TFS integration in Visual Studio. The "Pending Changes"-Dialog is going to be copied 1:1 (only some features like shelving and their controls are missing).

Installation:
Install the latest FD 4 and extract the attached Archive into the FlashDevelop plugin folder

Usage:
Use it the same way as in VS - the plugin detects automatically if a project-folder is under TFS-VersionControl and pop up the "Checkout"-Dialog if you try to edit a checked in file.

Known Issues:
Many features are still missing and some actions throw NotImplementedExceptions (Compare, Get specific Version, ...), but the basics are working.
This version is still BETA so expect some bugs, but we are already using it in production envirornment so it should be save to use.
There are some performance lags when using a high latency TFS connection.

Download/Source/More Info:
HERE

Changelog:
V0.4.1 - 2012-02-29:
- released the project on CodePlex
V0.4.1 - 2011-07-25:
- added some settings to choose which popups should be shown
V0.4 - 2011-07-23:
- adapted to use FD4 without the need of patching files
V0.3 - 2011-01-14:
- Project-Tree overlays
- SourceControl context menu
- loading stored work item queries
- basic policy handling
- very basic conflict listing
- many bugfixes
* usage of some FD4 features ported to FD3 (some original files are needed to be replaced)
V0.2 - 2011-01-04:
- First Release


Last edited by cfi on Wed Feb 29, 2012 3:45 pm, edited 6 times in total.



Tue Jan 04, 2011 12:14 pm
Profile WWW
Admin

Joined: Wed Aug 31, 2005 7:27 am
Posts: 12172
Location: London
Is it based on our SourceControl plugin?
Do you know it has an extensible architecture?


Tue Jan 04, 2011 12:55 pm
Profile WWW
Member

Joined: Sat Jun 26, 2010 7:29 pm
Posts: 25
Location: Feldkirch, Austria
Hi,

no, it is an own plugin, simply because when I started developing the plugin there was no SC-Plugin ;-).
I just had no time to make it "stabel for the public" until now.

I'm currently looking into the source of the SC-Plugin to eighter merge it or copy the "Project Tree Part".
I'm not shure if a mergin will work and/or makes sense, because TFS does have a completely different approach of handeling files/revisions and I definitly want to keep the dialogs similar to the VS integartion so TFS-usage is the same in FD and VS.

I'm also willing to share my code, but I'm wokring with VS 2010 at the moment so you can't include it into the FD Solution.

regards
cfi


Tue Jan 04, 2011 1:05 pm
Profile WWW
Admin

Joined: Wed Aug 31, 2005 7:27 am
Posts: 12172
Location: London
You can look into SC plugin source - your plugin should be kept separated and only register itself in the available VC managers.

SC doesn't force any UI - each VC is leveraging Tortoise* UIs or direct command line actions.

Is it possible to somewhat test TFS?


Tue Jan 04, 2011 1:17 pm
Profile WWW
Member

Joined: Sat Jun 26, 2010 7:29 pm
Posts: 25
Location: Feldkirch, Austria
As you need a TF-Server to test it, the easiest way is to grab a random project from codeplex.com which has TFS-Access...

I'm currently looking into the IVCManager and will try to combine it, but it's a little bit hard to know what is doing what exactly without any comments (I know developers [incl. me] don't like to make documentation, but at least at the interfaces it would be nice - like it is/was done in the FD-Main-Project)...

I will keep you posted on my status.


Tue Jan 04, 2011 1:41 pm
Profile WWW
Admin

Joined: Wed Aug 31, 2005 7:27 am
Posts: 12172
Location: London
Woops, yes it definitely needs comments...
To get started it is easier to duplicate classes from an existing VC.


Tue Jan 04, 2011 2:15 pm
Profile WWW
Member

Joined: Sat Jun 26, 2010 7:29 pm
Posts: 25
Location: Feldkirch, Austria
I'm now working on using the SC-Plugin, but I'm ranning into several problems, because the SC-Plugin is built for the SVN approach and TFS works differently, so for example the logic when to show menu items wont work for TFS. Also the method to add a new VCManger was internal, so I needed to change that so I was able to even register my manager - I will update the SC-Plugin to make it more "general" and "adaptable" and post my changes with the next version of my plugin.

But I'm having one problem I can't find a soultion: What do I need to do, to get the Overlay in the ProjectTreeView updated - the overlays are loaded correctly when they are loaded first, but I wasen't able to update then on a file change?


Fri Jan 07, 2011 8:30 am
Profile WWW
Admin

Joined: Wed Aug 31, 2005 7:27 am
Posts: 12172
Location: London
cfi wrote:
I'm now working on using the SC-Plugin, but I'm ranning into several problems, because the SC-Plugin is built for the SVN approach and TFS works differently, so for example the logic when to show menu items wont work for TFS. Also the method to add a new VCManger was internal, so I needed to change that so I was able to even register my manager - I will update the SC-Plugin to make it more "general" and "adaptable" and post my changes with the next version of my plugin.

But I'm having one problem I can't find a soultion: What do I need to do, to get the Overlay in the ProjectTreeView updated - the overlays are loaded correctly when they are loaded first, but I wasen't able to update then on a file change?

About the context menu maybe you're right - it should be possible to let your VCManager decide what to show. Just a note: if you set some items to 'null' then they will not be considered for addition in the list.

Your plugin can register a IVCManager this way:
Code:
SourceControl.Actions.ProjectWatcher.VCManagers.Add(myManager);


To update overlays, your plugin must fire the OnChange event and SC plugin will call your plugin GetOverlay method to check the files/dirs status.

PS: I added comments in IVCManager in FD4 branch.


Fri Jan 07, 2011 10:21 am
Profile WWW
Member

Joined: Sat Jun 26, 2010 7:29 pm
Posts: 25
Location: Feldkirch, Austria
Philippe wrote:
About the context menu maybe you're right - it should be possible to let your VCManager decide what to show. Just a note: if you set some items to 'null' then they will not be considered for addition in the list.

I know that with 'null', but its not enough for the TFS approach - I'm creating a generic solution ATM and will post it today or tomorrow.

Philippe wrote:
Your plugin can register a IVCManager this way:
Code:
SourceControl.Actions.ProjectWatcher.VCManagers.Add(myManager);


I know, but VCManagers was internal - changed that also...

Philippe wrote:
To update overlays, your plugin must fire the OnChange event and SC plugin will call your plugin GetOverlay method to check the files/dirs status.

I tried that but it didn't worked - maybee its a bug in my part - will check that again.

Philippe wrote:
PS: I added comments in IVCManager in FD4 branch.

I didn't saw that you working in FD4 now, because I was "adapting" the "FD3-Version" - I will update my version to the FD4 branch and insert my improvements there...


Fri Jan 07, 2011 10:33 am
Profile WWW
Member

Joined: Sat Jun 26, 2010 7:29 pm
Posts: 25
Location: Feldkirch, Austria
HERE is a first version of my changes/improvements.

Basic overview of my changes:
- the "Skin" can be changed from outside (so i can use the TFS-icons)
- the menu items are "replaced" with a dictionary where you can define MenuItems and rules when to show/enable them (old properties are still in but marked 'Obsolete')
- VCManager (and dependencies) are public so 'AddVCManager' can be called from outside (its better then use 'VCManagers.Add', because then the OnChange also gets registered)
- ProjectSelectionState is public and extended to fit TFS-needs (Modified & Replaced count added)
- FSWatcher also watches for Attribute changes (required to detect checkout from TFS)
UPDATE:
- Added FileActions for Open/Reload (->mark tabs as "Checked In"), ModifyRO (->Checkout to edit) and TestProject/BuildProject (->Chekcout output file)


Last edited by cfi on Fri Jan 07, 2011 5:55 pm, edited 1 time in total.



Fri Jan 07, 2011 11:27 am
Profile WWW
Member

Joined: Sat Jun 26, 2010 7:29 pm
Posts: 25
Location: Feldkirch, Austria
Is there a way/event to detect project changes, because I need to check out the project file if there are changes in the file?


Fri Jan 07, 2011 5:55 pm
Profile WWW
Admin

Joined: Wed Aug 31, 2005 7:27 am
Posts: 12172
Location: London
cfi wrote:
Is there a way/event to detect project changes, because I need to check out the project file if there are changes in the file?

Yes, in PluginMain:
- add EventType.Command in the event mask,
- in the EventHandler method, filter events matching EventType.Command type,
- cast the event to DataEvent and check that the event.Action == "ProjectManager.Project"


Fri Jan 07, 2011 6:43 pm
Profile WWW
Member

Joined: Sat Jun 26, 2010 7:29 pm
Posts: 25
Location: Feldkirch, Austria
Philippe wrote:
cfi wrote:
Is there a way/event to detect project changes, because I need to check out the project file if there are changes in the file?

Yes, in PluginMain:
- add EventType.Command in the event mask,
- in the EventHandler method, filter events matching EventType.Command type,
- cast the event to DataEvent and check that the event.Action == "ProjectManager.Project"


Thanks, but thats not what I ment - I need an event when the "project file" is changed (writing to the *.as3proj file), not when a project is opened...

BTW: Found a "Bug" in the main project:
In the "FileFromTemplate(String templatePath, String newFilePath)" method is the Event missing (EventType.FileTemplate) - I corrected it to:
Code:
public void FileFromTemplate(String templatePath, String newFilePath)
        {
            try
            {
                Encoding encoding = Encoding.GetEncoding((Int32)this.appSettings.DefaultCodePage);
                String contents = FileHelper.ReadFile(templatePath);
                String processed = this.ProcessArgString(contents);
                ActionPoint actionPoint = SnippetHelper.ProcessActionPoint(processed);
                FileHelper.WriteFile(newFilePath, actionPoint.Text, encoding, Globals.Settings.SaveUnicodeWithBOM);
                if (actionPoint.EntryPosition != -1)
                {
                    if (this.Documents.Length == 1 && this.Documents[0].IsUntitled)
                    {
                        this.closingForOpenFile = true;
                        this.Documents[0].Close();
                        this.closingForOpenFile = false;
                    }
                    TextEvent te = new TextEvent(EventType.FileTemplate, newFilePath);
                    EventManager.DispatchEvent(this, te);
                    if (!te.Handled)
                    {
                        ITabbedDocument document = (ITabbedDocument)this.CreateEditableDocument(newFilePath, actionPoint.Text, encoding.CodePage);
                        SnippetHelper.ExecuteActionPoint(actionPoint, document.SciControl);
                    }
                }
                else
                {
                    TextEvent te = new TextEvent(EventType.FileTemplate, newFilePath);
                    EventManager.DispatchEvent(this, te);
                }
            }
            catch (Exception ex)
            {
                ErrorManager.ShowError(ex);
            }
        }


Fri Jan 07, 2011 7:04 pm
Profile WWW
Admin

Joined: Wed Aug 31, 2005 7:27 am
Posts: 12172
Location: London
Well you can use a FileSystemWatcher to monitor the project file - or you mean you need to do something *before* it's modified? Then it would be needed to modify

Ok I checked your patch (BTW creating a SVN patch - easy in Tortoise, would be better).

Your modifications are pretty good. I think the code flagged "obsolete" is ok to keep and I'll call it "classic VC" ;) but your addition for a totally custom menu is ok for me.

I'll commit that in FD4 branch if you don't mind - if you still want to use FD3 (and distribute a FD3-compatible version of your plugin), you can still recompile SourceControl and your plugin against FD3's PluginCore.dll and it should be compatible with FD3.


Fri Jan 07, 2011 8:18 pm
Profile WWW
Member

Joined: Sat Jun 26, 2010 7:29 pm
Posts: 25
Location: Feldkirch, Austria
Yes, I need to do it before, because under TFS Checked In Files are Read-Only...

I can't create a SVN-Patch, because I'm using our Companies local TFS and I export the changes from there. I will try if I can use them side-by-side (should work as SVN doesn't 'change' files).

Your free to use my code wherever you want - I am compiling the SC-Plugin against FD3 ATM, because we are using FD3, but I always keep in mind to keep in "compatible".


Fri Jan 07, 2011 8:29 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 41 posts ]  Go to page 1, 2, 3  Next

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.