You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Rick Richardson <ri...@mn.rr.com> on 2001/10/24 16:02:48 UTC

svn update options for tkdiff???

The maintainer of "tkdiff" is about to make a new release with
support for Perforce and BitKeeper.

I was going to submit patches for Subversion, but I can't figure
out the Subversion equivalent to "cvs update -p".

When tkdiff wants to diff a CVS file, it issues "cvs update -p [-r xxx]"
to send the file to standard out.

Whats the equivalent option for subversion?

-Rick

Please CC me on any replies, as I am not a member of the dev list.

-- 
Rick Richardson  rickr@mn.rr.com      http://home.mn.rr.com/richardsons/
Twin Cities traffic animations are at http://tctraffic.0catch.com/

The last thing one knows in constructing a work is what to put first.
  -- Blaise Pascal

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn update options for tkdiff???

Posted by kf...@collab.net.
Rick Richardson <ri...@mn.rr.com> writes:
> If tkdiff just parsed the output of the SCM's diff command, that would
> presume that the SCM had a usable diff command.  That is not the case
> with all SCM's.  Even if it was the case, tkdiff would have to be
> taught how to parse the specific diff output for each SCM.  Thats far
> harder to do than to just teach it how to get a file at a specific
> revision level.

Makes sense to me, thanks for the explanation.

> "svn update" already seems to take a -r option.  It just needs the -p
> (pipe) option.  It wasn't obvious to me where the output file gets
> opened; point me at the place where the output file is opened, and
> maybe I can add it.

Here's the start of the code path you need to look at:

   subversion/subversion/libsvn_client/update.c:

      See the call to svn_wc_get_update_editor().  The "editor"
      referred to here is not a text editor like vi or emacs, it's a
      function vtable of type `svn_delta_edit_fns_t'.  Subversion
      drives the functions in this table to "edit" a directory tree,
      including file modifications, adds, deletes, etc.  There are
      several such editor vtables in Subversion; the particular one
      returned by svn_wc_get_update_editor() is the one that updates
      things in the working copy when you run "svn up".

      So probably svn_wc_get_update_editor() will take a new flag,
      `apr_file_t *alternate_output' or something.  If non-null, all
      file contents get redirected to that pipe and the update does
      not affect local revision numbers (same as CVS).

      The top-level -p flag would create such a pipe from stdout and
      pass it into svn_wc_get_update_editor().

Or something like that, you'll get the idea when you're in the code.

Thanks,
-K

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn update options for tkdiff???

Posted by Rick Richardson <ri...@mn.rr.com>.
kfogel@collab.net writes:
> Rick Richardson <ri...@mn.rr.com> writes:
> > The maintainer of "tkdiff" is about to make a new release with
> > support for Perforce and BitKeeper.
> > 
> > I was going to submit patches for Subversion, but I can't figure
> > out the Subversion equivalent to "cvs update -p".
> > 
> > When tkdiff wants to diff a CVS file, it issues "cvs update -p [-r xxx]"
> > to send the file to standard out.
> > 
> > Whats the equivalent option for subversion?
>>  
> Hmmm.  Not sure I understand the question, actually.  Why is tkdiff
> running "cvs up -p" to *diff* a CVS file?  Why not just run "cvs diff"
> instead?

tkdiff does the diff itself.  Thats the way it has always worked, and
that was the proper design choice.  "tkdiff" can show you a graphical
diff of any pair of files or file revisions, and is pretty much SCM-
agnostic once you teach it how to retrieve a file revision for a new
SCM.  It already knows how to retreive files with RCS, CVS, SCCS, PCVS,
AccuRev, Perforce, and BitKeeper.  And, of course, it can also work
with two plain files.

If tkdiff just parsed the output of the SCM's diff command, that would
presume that the SCM had a usable diff command.  That is not the case
with all SCM's.  Even if it was the case, tkdiff would have to be
taught how to parse the specific diff output for each SCM.  Thats far
harder to do than to just teach it how to get a file at a specific
revision level.

> nor does it implement "svn update -p" yet (though it might be some
> letter other than `p' when we do implement it, whatever).  The up -p
> functionality would be easy to add; the -r option to diff will be a
> bit more work, though it's also planned of course.

"svn update" already seems to take a -r option.  It just needs the -p
(pipe) option.  It wasn't obvious to me where the output file gets
opened; point me at the place where the output file is opened, and
maybe I can add it.

-Rick

-- 
Rick Richardson  rickr@mn.rr.com      http://home.mn.rr.com/richardsons/
Twin Cities traffic animations are at http://tctraffic.0catch.com/

Emacs would be a great operating system -- if only it had a decent editor.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn update options for tkdiff???

Posted by Ben Collins-Sussman <su...@collab.net>.
Rick Richardson <ri...@mn.rr.com> writes:

> The maintainer of "tkdiff" is about to make a new release with
> support for Perforce and BitKeeper.
> 
> I was going to submit patches for Subversion, but I can't figure
> out the Subversion equivalent to "cvs update -p".

This feature doesn't exist yet.  It's a feature request, issue #399.

The main reason we don't yet have the ability to dump an update to
STDOUT is because we already have an 'svn revert' command for undoing
changes.   That seems to be the primary use-case for 'cvs up -p'.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn update options for tkdiff???

Posted by kf...@collab.net.
Rick Richardson <ri...@mn.rr.com> writes:
> The maintainer of "tkdiff" is about to make a new release with
> support for Perforce and BitKeeper.
> 
> I was going to submit patches for Subversion, but I can't figure
> out the Subversion equivalent to "cvs update -p".
> 
> When tkdiff wants to diff a CVS file, it issues "cvs update -p [-r xxx]"
> to send the file to standard out.
> 
> Whats the equivalent option for subversion?

Hmmm.  Not sure I understand the question, actually.  Why is tkdiff
running "cvs up -p" to *diff* a CVS file?  Why not just run "cvs diff"
instead?

Currently, subversion implements plain "svn diff", but not yet 

   svn diff -r xxx
   svn diff -r xxx -r yyy

nor does it implement "svn update -p" yet (though it might be some
letter other than `p' when we do implement it, whatever).  The up -p
functionality would be easy to add; the -r option to diff will be a
bit more work, though it's also planned of course.

Would like to understand the tkdiff's motivations better, though...

-K

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org