Bug 203001 - [usability] Support remote folder compares
Summary: [usability] Support remote folder compares
Status: ASSIGNED
Alias: None
Product: Target Management
Classification: Tools
Component: RSE (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement with 4 votes (vote)
Target Milestone: Future   Edit
Assignee: David McKnight CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords: helpwanted
Depends on: 185925
Blocks:
  Show dependency tree
 
Reported: 2007-09-11 17:01 EDT by Nick Boldt CLA
Modified: 2008-10-06 16:33 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Boldt CLA 2007-09-11 17:01:09 EDT
Just started using TM this week -- very cool. I love the fact that I can diff a local and remote file (or two remote files). Very handy.

That said, would folder compares be possible?

This would be super useful for diffing local (staging/CVS) and remote (production), or remote (staging) with remote (production) servers. Or even better, keeping things in synch (a la Synchronize view?)

Basically, I'd like to be able to select two folders in the Remote Systems view and be able to diff them in Eclipse. Or, better, handle these folders like local folders so that I can hook in another diff tool, like Beyond Compare or even just diff itself. I'm guessing that would mean a lot of downloading and caching of remote files locally, on demand when I pick a remote folder to compare, then pointing whatever diff tool is requested (BC, diff, Eclipse compare) at those now locally cached folders.
Comment 1 Martin Oberhuber CLA 2007-09-12 07:35:42 EDT
For synchronization, I believe we'd want the RSE IFileService be a provider for the Platform/Team synchronization framework. This is covered in bug #185925.

Diffing remote folders through Platform Structure Compare seems like a great idea (Multiselect, right-click > Compare with > Each other). Ideally, in a first step only the file lists (and timestamps/sizes) would be retrieved to show the structure compare, and the download for actual content compare could be done on demand, when the user asks for actual download. I'm not sure, though, whether the Platform Structure Compare framework supports such deferred operation or needs the entire contents right away.

I'd assume that the Platform Structure Compare framework would already care for pluggable diff engines, but I'm not sure about that either.

Adding MichaelV on CC for the questions regarding the Compare Framework.
Assigning DaveM for comments.
Comment 2 Michael Valenta CLA 2007-09-12 10:24:34 EDT
The Compare framework will fetch the contents when a compare viewer is opened. However, the contents are not fetched asynchronously. For this reason, we always prefetch and cache contents before opening the a compare editor on a remote file (e.g. CVS). However, this would be a lot more resource intensive when comparing remote folders.

As for the diff engine, it is best to think of the Compare framework as a diff engine itself. In that light, it would be possible for any client in Eclipse to support multiple diff engines, but the Compare framework itself would not surface this choice. It would be up to clients like RSE to do so. However, at the current time, I am not aware of any clients that do (except for perhaps some proprietary tools) and I don't expect that many of the existing clients would want to go through the process of adding such support (i.e. I suspect that, from their perspective, it would be a fair bit of work for little gain). Perhaps a more fruitful approach would be to identify enhancements to the Eclipse compare support that would make it better than Beyond Compare.
Comment 3 David McKnight CLA 2007-09-12 10:29:44 EDT
A while back, when I first coded the compare stuff (with IBM RSE), I had the compare folders feature working.  The problem was that Eclipse would require that all the files within the folder be in the workspace - so this could potentially cause a massive set of downloads.  Because of that, I took that feature out.  I'm not sure if there's anyway to do this without picking up everything from each folder.
Comment 4 Martin Oberhuber CLA 2007-09-12 10:31:57 EDT
(In reply to comment #2)
Do I get this right:

Assume I'm doing Structure Compare of 2 directory trees of 100 files each, with
5 files added, 5 files removed, and 5 files differing. The client (i.e. RSE)
would be responsible for compiling the list of differing files, and then, while
the structure diff view is being populated, prefetch and cache the 20 files (5
only from A, 5 only from B, 5 differing from both A and B).

In other words, we would prepare a local shadow of the differences only, then
have the structure diff tool operate on those, and when anything is
saved/changed be responsible for uploading.

Or could the framework help with any of these?
Comment 5 Martin Oberhuber CLA 2007-09-12 10:34:42 EDT
PS for compiling the list of differing files, it could be a Preference setting whether matching size would suffice to treat files as identical. When a Shell channel is available, md5sum or similar could also be done on the remote, as an additional option to avoid downloading everything at once.

Speaking the rsync protocol could also be an interesting option for structure diff, when an rsync server is available remotely.
Comment 6 Michael Valenta CLA 2007-09-12 10:43:45 EDT
At its most general, the compare framework does not depend on resources being in the workspace. However, it doesn't help you much if you don;t have an IResource (i.e. you would need to implement your own ITypeElements and all the supporting interfaces (IStreamContentAccessor, etc).
Comment 7 Chris Aniszczyk CLA 2007-09-13 15:52:48 EDT
(In reply to comment #3)

David, it might be interesting to post what you had so other people could look at it... if you so desire of course.
Comment 8 Martin Oberhuber CLA 2007-09-13 15:58:17 EDT
Take care - sine this is work pre-dating Dave's engagement as a committer, it would potentially not be under EPL and need to go through Legal Review (code is owned by IBM I'd guess).
Comment 9 David McKnight CLA 2007-09-13 16:02:06 EDT
What I had before wasn't really that much different.  If I remember correctly, the key difference was that all the files in the folders to compare were downloaded prior to the folder compare.  Ultimately the resources that get compared are cached in the RemoteSystemTempFiles project, so once the files are downloaded, the compare was the same as a regular folder compare.    
Comment 10 Martin Oberhuber CLA 2008-08-05 14:51:13 EDT
Related to Synchronization (bug 185925)