<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Aug 29, 2016 at 3:32 PM, Matt Mackall <span dir="ltr"><<a href="mailto:mpm@selenic.com" target="_blank">mpm@selenic.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Mon, 2016-08-29 at 11:50 -0700, Stanislau Hlebik wrote:<br>
> # HG changeset patch<br>
> # User Stanislau Hlebik <<a href="mailto:stash@fb.com">stash@fb.com</a>><br>
> # Date 1472496038 25200<br>
> #      Mon Aug 29 11:40:38 2016 -0700<br>
> # Node ID e1962781ce84040746ef79c0084b8f<wbr>d70cfcd4b4<br>
> # Parent  <wbr>318e2b600b80e4ed3c6f37df46ec75<wbr>44f60d4c0b<br>
> update: do not remove cwd<br>
><br>
> During update directories are deleted as soon as they have no entries.<br>
> But current working directory shouldn't be deleted because it<br>
> causes problems for users after hg finishes.<br>
<br>
</span>It is a perfectly valid state that POSIX allows. So we shouldn't make those<br>
problems our problems.<br></blockquote><div><br></div><div>Windows does not allow the deletion of opened files. And having explorer.exe or a command prompt/shell in a directory is enough to maintain an open file handle. In short, you can't delete cwd on Windows.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class=""><br>
>  Also it makes complex commands<br>
> like 'hg split' fail.<br>
<br>
</span>Those failures are also arguably bugs in their own right.<br>
<br>
But this approach introduces new complexities. For instance, what happens if the<br>
current directory gets replaced by a symlink? Whether that works depends on<br>
where you run the command. And how does the not-deleted directory get cleaned up<br>
so as not to interfere with future operations?<br>
<br>
If we wanted to disallow this, we'd ideally abort early so the user could run<br>
the operation in a sane location. But that's not generally easy to discover. And<br>
aborting later is likely to make a mess.<br>
<br>
(Alternate idea: rename the current directory to .oh-no-you-ran-an-hg-command-<br>
that-deleted-your-current-<wbr>directory-please-clean-up-<wbr>your-mess-kthxbye.)<br>
<span class="HOEnZb"><font color="#888888"><br>
-- <br>
Mathematics is the supreme nostalgia of our time.<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
______________________________<wbr>_________________<br>
Mercurial-devel mailing list<br>
<a href="mailto:Mercurial-devel@mercurial-scm.org">Mercurial-devel@mercurial-scm.<wbr>org</a><br>
<a href="https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel" rel="noreferrer" target="_blank">https://www.mercurial-scm.org/<wbr>mailman/listinfo/mercurial-<wbr>devel</a><br>
</div></div></blockquote></div><br></div></div>