You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Martin Hauner <Ma...@gmx.net> on 2005/05/26 09:08:44 UTC
show diffs in a gui client, how to get a list of changed files?
Hi,
I would like to handle diffs on urls/paths (tags/branches) in subcommander
by presenting a list of the files with differences and by showing the diff
when you select a file from the list.
For example if i want to see the difference between the trunk and a tag and
the file subcommander.cpp was changed i would like to get the following info
trunk/subcommander/subcommander.cpp, r800
tags/0.9.0/subcommander/subcommander.cpp, r750
subcommander.cpp will be presented in the gui in a list view. I can then
select it to see the differences in detail by running the diff:
svn_client_diff( "trunk/subcommander/subcommander.cpp", 800,
"tags/0.9.0/subcommander/subcommander.cpp", 705, ... );
What i would like to get from the svn api is a list of the files with
differences and the info i need to run the diff on those files to show their
difference.
I looked into the code but there is lot of stuff happening inside
svn_client_diff..
Where do i start to get this info from the subversion api?
--
Martin
Subcommander, http://subcommander.tigris.org
a x-platform Win32/Unix/Linux/MacOSX svn gui client & a text diff/merge
tool.
5 GB Mailbox, 50 FreeSMS http://www.gmx.net/de/go/promail
+++ GMX - die erste Adresse f�r Mail, Message, More +++
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: show diffs in a gui client, how to get a list of changed files?
Posted by Martin Hauner <ma...@gmx.net>.
Ben Collins-Sussman wrote:
>
> On May 27, 2005, at 3:55 AM, Martin Hauner wrote:
>
>> Max Bowsher wrote:
>>
>>> Issue 2015 - it's already filed!
>>>
>>
>> If someone outlines what has do be done in the code and where
>> i would do some work on it.
>
>
>
> Start with svn_client_diff(), and then follow the codepath for a URL-
> URL diff. My understanding is that an RA request is sent to the server
> which instructs it to compare two trees, and the result is an
> editor-drive. The particular client-side editor that is driven is
> written to drive *another* vtable known as 'diff_callbacks_t'. There
> are currently two implementations of diff_callbacks_t: one which
> prints diffs to the screen ('svn diff URL1 URL2') and one which merges
> diffs into working-files ('svn merge URL1 URL2'). The goal here, I
> believe, is to write a third implementation of diff_callbacks_t, one
> which uses our notification system to merely print status codes.
Using the notify function svn_wc_notify_func2_t would require to
extend svn_wc_notify_t. It doesn't hold all necessary information.
What would be needed?
It would at least need two new members, a second revision and the author.
The second revision because #2015 wants to see the last revision number
prior to change and the last changed revision number. svn_wc_notify_t
has only one revision. Another reason is that a gui client would need
two revisions to run a diff later.
The author because #2015 likes to see the author of the second revision.
We would also need a few more svn_wc_notify_action_t values for the
different change types so we don't need to overload existing notify actions.
The command line client would simply print the diff summarize.
A gui client would have to remember the info to display it in the gui and
to run diffs on the changed items if a user wants to see a detailed diff.
In subcommander i currently use the notify function only to print some
progress info and not to collect "real" information that will be used
elsewhere. I think the second "smells" a little bit. :) or not?
What was the orginal intention of the notify function? To print progress
information or to collect information that will/can be used somewhere else?
Or both?
I would like an api call which directly returns this information or maybe
like svn_client_status with its svn_wc_status_func2_t.
But i guess this would need more work.
--
Martin
Subcommander, http://subcommander.tigris.org
a x-platform Win32/Unix/Linux/MacOSX svn gui client & a text diff/merge tool.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: show diffs in a gui client, how to get a list of changed files?
Posted by Ben Collins-Sussman <su...@collab.net>.
On May 27, 2005, at 3:55 AM, Martin Hauner wrote:
> Max Bowsher wrote:
>
>> Issue 2015 - it's already filed!
>>
>
> If someone outlines what has do be done in the code and where
> i would do some work on it.
Start with svn_client_diff(), and then follow the codepath for a URL-
URL diff. My understanding is that an RA request is sent to the
server which instructs it to compare two trees, and the result is an
editor-drive. The particular client-side editor that is driven is
written to drive *another* vtable known as 'diff_callbacks_t'. There
are currently two implementations of diff_callbacks_t: one which
prints diffs to the screen ('svn diff URL1 URL2') and one which
merges diffs into working-files ('svn merge URL1 URL2'). The goal
here, I believe, is to write a third implementation of
diff_callbacks_t, one which uses our notification system to merely
print status codes.
It's possible that you could start by simply copying the 'merge'
implementation of diff_callbacks_t and then hack on it; it already
outputs status codes, you'd just have to make it not change any
working-copy data.
(Hm, maybe the issue should link to this mail...?)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: show diffs in a gui client, how to get a list of changed files?
Posted by Martin Hauner <ma...@gmx.net>.
Max Bowsher wrote:
>
> Issue 2015 - it's already filed!
>
If someone outlines what has do be done in the code and where
i would do some work on it.
--
Martin
Subcommander, http://subcommander.tigris.org
a x-platform Win32/Unix/MacOSX svn gui client & a text diff/merge tool.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: show diffs in a gui client, how to get a list of changed files?
Posted by Max Bowsher <ma...@ukf.net>.
Ben Collins-Sussman wrote:
> On May 26, 2005, at 5:46 AM, SteveKing wrote:
>>
>> And as far as I can remember, there have already been some requests
>> about this kind of feature for people who want to use this list for
>> their scripts.
>
>
> Yeah, I've been asking for this same feature for a while too,
> something like:
>
> $ svn diff URL1@X URL2@Y --list-files
> M foo.c
> M bar.c
> A baz.h
> D blah
> [...]
>
> The output would be similar to what 'svn merge --dry-run' already
> does. I think it's just a matter of writing a new set of
> diff_callbacks_t for the URL-URL diff codepath. Would anyone object
> if I filed an enhancement request for this? I see this request over
> and over from users too.
Issue 2015 - it's already filed!
Max.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: show diffs in a gui client, how to get a list of changed files?
Posted by Ben Collins-Sussman <su...@collab.net>.
On May 26, 2005, at 3:58 PM, Marcus Rueckert wrote:
> urls:
> svn diff url1 url2 | grep "^Index"
>
You saw the mail I just sent, saying that I'm tired of recommending
this command to users, right? And about how it doesn't deal with
tree changes? :-)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: show diffs in a gui client, how to get a list of changed files?
Posted by Marcus Rueckert <da...@web.de>.
urls:
svn diff url1 url2 | grep "^Index"
revisions:
svn log -q -v
-q removes the log messages
-v adds the file list
darix
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: show diffs in a gui client, how to get a list of changed files?
Posted by SteveKing <st...@gmx.ch>.
Daniel Rall wrote:
> On Thu, 2005-05-26 at 09:11 -0500, Ben Collins-Sussman wrote:
>>Yeah, I'm getting really tired of telling users to run
>>
>> svn diff URL1@X URL2@Y | grep "Index:"
>>
>>That's not even a complete listing; it ignores directory adds/deletes.
>
>
> While reading some of the "Log Message Templates" thread, it struck me
> that we already have the code to do this -- it's used to insert the list
> of files that changed into the user's editor (when doing a commit
> without specifying -m or -F to provide a log message).
Not quite true. That function creates a list of locally modified/changed
files. What we need is a function which returns a list of changed
files/folders between two revisions/URLs in the repository.
Stefan
--
___
oo // \\ "De Chelonian Mobile"
(_,\/ \_/ \ TortoiseSVN
\ \_/_\_/> The coolest Interface to (Sub)Version Control
/_/ \_\ http://tortoisesvn.tigris.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: show diffs in a gui client, how to get a list of changed files?
Posted by Daniel Rall <dl...@finemaltcoding.com>.
On Thu, 2005-05-26 at 09:11 -0500, Ben Collins-Sussman wrote:
>On May 26, 2005, at 9:04 AM, John Szakmeister wrote:
>>>
>>> $ svn diff URL1@X URL2@Y --list-files
>>> M foo.c
>>> M bar.c
>>> A baz.h
>>> D blah
>>> [...]
>>>
>>> The output would be similar to what 'svn merge --dry-run' already
>>> does. I think it's just a matter of writing a new set of
>>> diff_callbacks_t for the URL-URL diff codepath. Would anyone
>>> object if
>>> I filed an enhancement request for this? I see this request over
>>> and
>>> over from users too.
>>>
>>
>> I think it's a great idea. I find myself looking for that information
>> quite a bit as well.
>
>
>Yeah, I'm getting really tired of telling users to run
>
> svn diff URL1@X URL2@Y | grep "Index:"
>
>That's not even a complete listing; it ignores directory adds/deletes.
While reading some of the "Log Message Templates" thread, it struck me
that we already have the code to do this -- it's used to insert the list
of files that changed into the user's editor (when doing a commit
without specifying -m or -F to provide a log message).
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: show diffs in a gui client, how to get a list of changed files?
Posted by Ben Collins-Sussman <su...@collab.net>.
On May 26, 2005, at 9:04 AM, John Szakmeister wrote:
>>
>> $ svn diff URL1@X URL2@Y --list-files
>> M foo.c
>> M bar.c
>> A baz.h
>> D blah
>> [...]
>>
>> The output would be similar to what 'svn merge --dry-run' already
>> does. I think it's just a matter of writing a new set of
>> diff_callbacks_t for the URL-URL diff codepath. Would anyone
>> object if
>> I filed an enhancement request for this? I see this request over
>> and
>> over from users too.
>>
>
> I think it's a great idea. I find myself looking for that information
> quite a bit as well.
Yeah, I'm getting really tired of telling users to run
svn diff URL1@X URL2@Y | grep "Index:"
That's not even a complete listing; it ignores directory adds/deletes.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: show diffs in a gui client, how to get a list of changed files?
Posted by John Szakmeister <jo...@szakmeister.net>.
Ben Collins-Sussman wrote:
>
> On May 26, 2005, at 5:46 AM, SteveKing wrote:
>
>>
>> And as far as I can remember, there have already been some requests
>> about this kind of feature for people who want to use this list for
>> their scripts.
>
>
>
> Yeah, I've been asking for this same feature for a while too, something
> like:
>
> $ svn diff URL1@X URL2@Y --list-files
> M foo.c
> M bar.c
> A baz.h
> D blah
> [...]
>
> The output would be similar to what 'svn merge --dry-run' already
> does. I think it's just a matter of writing a new set of
> diff_callbacks_t for the URL-URL diff codepath. Would anyone object if
> I filed an enhancement request for this? I see this request over and
> over from users too.
I think it's a great idea. I find myself looking for that information
quite a bit as well.
-John
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: show diffs in a gui client, how to get a list of changed files?
Posted by Ben Collins-Sussman <su...@collab.net>.
On May 26, 2005, at 5:46 AM, SteveKing wrote:
>
> And as far as I can remember, there have already been some requests
> about this kind of feature for people who want to use this list for
> their scripts.
Yeah, I've been asking for this same feature for a while too,
something like:
$ svn diff URL1@X URL2@Y --list-files
M foo.c
M bar.c
A baz.h
D blah
[...]
The output would be similar to what 'svn merge --dry-run' already
does. I think it's just a matter of writing a new set of
diff_callbacks_t for the URL-URL diff codepath. Would anyone object
if I filed an enhancement request for this? I see this request over
and over from users too.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: show diffs in a gui client, how to get a list of changed files?
Posted by SteveKing <st...@wagner-group.ch>.
Martin Hauner wrote:
> I would like to handle diffs on urls/paths (tags/branches) in subcommander
> by presenting a list of the files with differences and by showing the diff
> when you select a file from the list.
>
> For example if i want to see the difference between the trunk and a tag and
> the file subcommander.cpp was changed i would like to get the following info
>
> trunk/subcommander/subcommander.cpp, r800
> tags/0.9.0/subcommander/subcommander.cpp, r750
What's also needed here is information about the kind (folder/file), and
if it's a property change or a content change.
> subcommander.cpp will be presented in the gui in a list view. I can then
> select it to see the differences in detail by running the diff:
>
> svn_client_diff( "trunk/subcommander/subcommander.cpp", 800,
> "tags/0.9.0/subcommander/subcommander.cpp", 705, ... );
Or even better: an svn_client_cat() on both files, then start a visual
diff tool.
> What i would like to get from the svn api is a list of the files with
> differences and the info i need to run the diff on those files to show their
> difference.
>
> I looked into the code but there is lot of stuff happening inside
> svn_client_diff..
>
> Where do i start to get this info from the subversion api?
I also want to ask for this feature to use in TSVN. Currently, I'm doing
an svn_client_diff() on both URL's, then parse the returned unified diff
for the file list. But that is *awfully* slow if there are a lot of
changes between those two branches - I once did a test and cancelled it
after 5 minutes because it still wasn't finished with svn_client_diff()!
As Martin already said: this feature would be used to show the list of
changed files so the user can then start a diff tool on that file.
And as far as I can remember, there have already been some requests
about this kind of feature for people who want to use this list for
their scripts.
Stefan
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org