[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] svn diff -r1:BASE URL asserts

From: <kfogel_at_collab.net>
Date: 2006-03-08 02:00:53 CET

Michael W Thelen <mike@pietdepsi.com> writes:
> I have to apologize for letting this patch sit so long without being
> addressed. Would any developer be able to review Paul's patch? If not,
> I'll file an issue for in within a few days. Here is a link to Paul's
> patch in the archive:
> http://svn.haxx.se/dev/archive-2006-01/0350.shtml

Paul, +1 to commit. Here's a new patch, exactly the same as yours
except with a custom error message, because the generic one wouldn't
be clear in this scenario. The generic one just said "A path under
version control is needed for this operation", to which the creative
user might reply "But of course it's under version control, it's in
the repository!" :-)

Feel free to change the custom error message if you think of a better
phrasing, of course.


Return consistent error on svn diff of special revisions BASE, COMMITTED,
or PREV when operating on a URL.

The original impetus for this patch was to stop svn diff 1:BASE URL from
asserting, and to provide a more useful error message.

Approved by: kfogel

* subversion/svn/diff-cmd.c
  (svn_cl__diff): If the starting or ending revision against a URL is
  BASE, COMMITTED, or PREV return an error.

Index: subversion/svn/diff-cmd.c
--- subversion/svn/diff-cmd.c (revision 18760)
+++ subversion/svn/diff-cmd.c (working copy)
@@ -206,6 +206,21 @@
                                  _("Target lists to diff may not contain "
                                    "both working copy paths and URLs"));
+ /* Diffing special revisions BASE, COMMITTED, or PREV
+ against a URL is invalid. */
+ if (url_present
+ && (opt_state->start_revision.kind == svn_opt_revision_base
+ || opt_state->end_revision.kind == svn_opt_revision_base
+ || opt_state->start_revision.kind == svn_opt_revision_committed
+ || opt_state->end_revision.kind == svn_opt_revision_committed
+ || opt_state->start_revision.kind == svn_opt_revision_previous
+ || opt_state->end_revision.kind == svn_opt_revision_previous))
+ return svn_error_create
+ _("That symbolic revision name(s) is only for "
+ "working copy paths, not URLs"));
       if (opt_state->start_revision.kind == svn_opt_revision_unspecified
           && working_copy_present)
           opt_state->start_revision.kind = svn_opt_revision_base;

To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Mar 8 03:48:09 2006

This is an archived mail posted to the Subversion Dev mailing list.