[PATCH 2 of 4 RFC V2] localrepo: add "wc" symbol to specify workingctx by command (BC)

Augie Fackler raf at durin42.com
Mon Mar 16 14:24:08 CDT 2015


On Mar 16, 2015, at 3:09 PM, Matt Mackall <mpm at selenic.com> wrote:

> On Mon, 2015-03-16 at 13:29 -0400, Augie Fackler wrote:
>> On Tue, Mar 17, 2015 at 12:16:49AM +0900, Yuya Nishihara wrote:
>>> On Mon, 16 Mar 2015 10:50:08 -0400, Jordi GutiƩrrez Hermoso wrote:
>>>> On Mon, 2015-03-16 at 23:04 +0900, Yuya Nishihara wrote:
>>>>> # HG changeset patch
>>>>> # User Yuya Nishihara <yuya at tcha.org>
>>>>> # Date 1408247327 -32400
>>>>> #      Sun Aug 17 12:48:47 2014 +0900
>>>>> # Node ID 3e97838d4eaa3f4f5131f1f1997ead72acc81aad
>>>>> # Parent  193f5a309da2beea925fd22a6e039bb2dcee7a81
>>>>> localrepo: add "wc" symbol to specify workingctx by command (BC)
>>>> 
>>>> I really like where this is going... but introducing more syntax...?
>>>> 
>>>>> Pros and cons:
>>>>> 
>>>>>  "wc" symbol:
>>>>>   - is easy to type
>>>>>   - can be used as a first-class symbol to specify wctx by string
>>>>>     (would avoid problems such as caff3675cba5)
>>>>>  "wc()" function:
>>>>>   - has no behavior change
>>>> 
>>>> Big contra: it is short enough to conflict with existing bookmarks,
>>>> tags, or revset aliases the user has defined. Smaller contra: "wc"
>>>> means "toilet" or "bathroom" in several European languages.
>>> 
>>> And in Japanese, yes, it means toilet. I just picked "wc" from subrepo.py.
>>> Other possible words: wdir, wdir(), workingdir(), ...
>>> 
>>>> Since "." is used for p1, how about making "./" refer to your proposed
>>>> "wc"? This does not conflict with existing syntax, is short, and I
>>>> believe cannot be the name of a revset alias. It also looks like
>>>> "current directory" in Unix-speak.
>>> 
>>> "./" sounds too magical for me. It doesn't look like a single symbol.
>> 
>> Agreed. Also, in filesystems . and ./ mean the same thing, so that'd
>> be confusing too.
> 
> We had actually planned to use '@' for this, but somehow ended up using
> it to mean a) '.' in graphlog b) default bookmark. Sad.
> 
> Anyway, I think the term we should standardize on is "working
> directory". It doesn't have any other unfortunate uses, it's what in "hg
> help glossary" and it's also the most common in our messages:
> 
> $ hgrep "working copy" | grep ui
> hgext/convert/subversion.py:            ui.status(_('initializing svn working copy %r\n')
> mercurial/cmdutil.py:                    ui.warn(_('%s: deleted in working copy\n') % relsrc)
> mercurial/commands.py:        ui.status(_("(run 'hg update' to get a working copy)\n"))

+1 to working directory. I probably introduced the two working copy cases that aren't talking about svn, because that's svn jargon.

Are both of these cases fair game to change to working directory? The second one looks like it's in a hint, so that seems okay.

> 
> $ hgrep "working directory" | grep ui
> hgext/extdiff.py:        ui.note(_('making snapshot of %d files from working directory\n') %
> hgext/mq.py:                self.ui.status(_("(working directory not at a head)\n"))
> hgext/mq.py:                self.ui.warn(_('cleaning up working directory...'))
> hgext/mq.py:        ui.warn(_('warning: uncommitted changes in the working directory\n'))
> hgext/patchbomb.py:            ui.warn(_('warning: working directory has '
> hgext/rebase.py:                            ui.status(_('nothing to rebase - working directory '
> hgext/rebase.py:            ui.note(_("update back to initial working directory parent\n"))
> mercurial/commands.py:            ui.status(_('reset working directory to branch %s\n') % label)
> mercurial/commands.py:            ui.status(_('marked working directory as branch %s\n') % label)
> mercurial/commands.py:      - generate a build identifier for the working directory::
> mercurial/context.py:        building a new manifest if self (working directory) is not comparing
> mercurial/hg.py:        r.ui.status(_("updating working directory\n"))
> mercurial/localrepo.py:                ui.status(_('working directory now based on '
> mercurial/localrepo.py:                ui.status(_('working directory now based on '
> mercurial/patch.py:    """use builtin patch to apply <patchobj> to the working directory.
> 
> -- 
> Mathematics is the supreme nostalgia of our time.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20150316/31af556e/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20150316/31af556e/attachment.pgp>


More information about the Mercurial-devel mailing list