[MERGE] line-endings support: part 1 of 2: versioned properties
Neil Martinsen-Burrell
nmb at wartburg.edu
Mon Apr 14 19:36:18 BST 2008
Alexander Belchenko wrote:
> Neil Martinsen-Burrell пишет:
>> Nicholas Allen <allen <at> ableton.com> writes:
>>
>>
>>> Also I think the property name and value as first two arguments makes
>>> more sense from the user's point of view because the command changes
>>> a property and so the property name and value are the most important
>>> part. Perhaps the notation name=value would also be better rather
>>> than having a space (it is easier to see what you mean and would
>>> catch error when you don't do this). e.g:
>>>
>>> bzr prop-set name=value file1 file2 file3....
>>>
>>> For me this is the clearest and most logical syntax but I understand
>>> that this is a matter of taste/opinion and others may disagree.
>>> Another nice thing about this syntax is you could set multiple
>>> properties with one command:
>>>
>>> bzr prop-set name1=value1 name2=value2 file1 file2 file3....
>>>
>>> I like the equals sign because it makes it very clear what is a
>>> property name and what is a value on the command line and these
>>> cannot be confused with file names either.
>>
>> I agree that this looks like the best structure for this command line.
>> One
>> (tangential) data point is that Subversion's propset command is of the
>> form "svn
>> propset PROPNAME PROPVAL PATH...", so this structure comports with a
>> "standard".
>> On the downside of the Subversion way, I find it confusing that the
>> name and
>> value are not connected in any way, and spaces are particularly
>> complicated to
>> place into property values.
>
> Why it so? Does the quoting of value is not work at all for you? I.e.
>
> svn propset foo "spam eggs fish" PATH...
>
> As I know this at least should works on Windows.
I'm mistaken. Escaping works in svn propset, as it would in bzr prop-set
>> (Is that also the case here?) With Nick's
>> suggestion, I also like the ability to set multiple properties with a
>> single
>> command.
>>
>> I think that a good set of examples in "bzr help prop-set" will
>> emphasize that
>> glob expansion can be done at runtime (using a quoted pattern). As
>> well, the
>> usage message could be "prop-set PROPNAME=PROPVAL ... PATTERN ..."
>> with some
>> explanation then of what is a legal pattern (a filename (including a
>> path?) or a
>> glob expression).
>
>> In fact, we could leverage some of the code, as well as some
>> mental complexity by making the possible patterns in prop-set the same
>> as the
>> patterns in ignore.
>
> Currently my code assume that filemasks should always start with '*'.
> It's makes
> the implementation much simpler.
It certainly would make it much simpler, but I think at an added mental
cost for every user of patterns. One would have to remember that
patterns in the properties files are restricted to a (very) limited
subset of the possible patterns that can be used in other parts of
Bazaar. You are only using the requirement that the pattern start with
'*' to disambiguate between file-ids and glob patterns. There must be
another way of doing this that is not so restrictive. Once that is
done, you current implementation should work exactly as is.
-Neil
More information about the bazaar
mailing list