mercurial at 11238: 10 new changesets (3 stable)
Henrik Stuart
hg at hstuart.dk
Thu Jun 3 14:42:24 CDT 2010
On 03-06-2010 21:19, Cedric Duval wrote:
> Henrik Stuart wrote:
>> On 01-06-2010 20:55, Cedric Duval wrote:
>>>> http://selenic.com/repo/hg//rev/1e701ffd9df4
>>>> changeset: 11229:1e701ffd9df4
>>>> user: Henrik Stuart <hg at hstuart.dk>
>>>> date: Sat May 29 20:32:39 2010 +0200
>>>> summary: mq: support multiple patch queues using qqueue
>
>>> This is a very nice feature to have, thanks!
>
>>> I am however a bit uncomfortable with the way those new queues are
>>> stored, making it possible to have any arbitrary name inside the
>>> .hg/ directory.
>
>>> Just a few tested examples below:
>
>>> + hg init r
>>> + cd r
>>> + hg qqueue --create store
>>> + hg qnew journal
>>> abandon : abandoned transaction found - run hg recover !
>
>>> + hg init r
>>> + cd r
>>> + hg qqueue --create branch
>>> + hg qnew p
>>> + hg branch b
>>> abandon : Is a directory : /tmp/qq/r/.hg/branch
>
>>> + hg init r
>>> + cd r
>>> + hg qqueue --create dirstate
>>> + hg qnew p
>>> abandon : Is a directory
>
>>> Those examples are obviously contrived (especially the last one),
>>> and one could find them disingenuous name choices from the user,
>>> but when anything is allowed (and given that the .hg layout may
>>> evolve, adding new files or directories - which are not always
>>> created right away, but sometimes after some specific actions),
>>> I fear that there is a real concern that name clashes _will_ occur,
>>> probably in rare and particular cases, but this might be a cause
>>> for some future trouble.
>
>>> The ideal would be to give those queues a dedicated namespace,
>>> for instance by putting them in .hg/mq/, where no collision could
>>> occur, and in order to retain compatibility .hg/patches/ would
>>> simply become a symbolic link pointing there. But symbolic links
>>> are not really a possibility on most Windows releases as far as I
>>> know, so something else probably has to be found...
>
>>> So I'm afraid I'm not coming up with a good solution or patch, just
>>> some thoughts, before it becomes carved in stone with next release.
>
>> Quite devious naming you thought up there. :o)
>
>> I have pushed a revised patch that limits the allowed names somewhat and
>> guards against these cases.
>
> Actually, looking more closely at this patch, I'm not sure the test
> added under "%% tricky cases" serves any purpose. Creating a queue
> named "test" under .hg/store was not a failing case before (only
> slightly messy). If an effective test is desired for tricky cases,
> it should be for instance "journal" under store, or some equivalently
> devious naming schemes like above.. :)
Right you are. Pushed an updated patch utilising your journal
suggestion. Thanks.
--
Kind regards,
Henrik Stuart
More information about the Mercurial-devel
mailing list