Re: [PATCH 1 of 2] dispatch: move part of callcatch to scmutil

2016-11-24 Thread Yuya Nishihara
On Thu, 24 Nov 2016 13:39:25 +, Jun Wu wrote:
> Excerpts from Yuya Nishihara's message of 2016-11-24 22:28:28 +0900:
> > This seems better belonging to the high-level callcatch(), but anyway it 
> > looks
> > like a moot. If C extensions aren't compiled at all, ImportError would be
> > raised earlier.
> 
> demandimport could be a source of (surprising) ImportErrors with 3rd-party
> code. Like hgsubversion imports svn binding, while the binding does not
> exist.

Yeah, but "hg" calls util.setbinary(), where ImportError would be raised if
osutil.so is missing.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH 1 of 2] dispatch: move part of callcatch to scmutil

2016-11-24 Thread Jun Wu
Excerpts from Yuya Nishihara's message of 2016-11-24 22:28:28 +0900:
> This seems better belonging to the high-level callcatch(), but anyway it looks
> like a moot. If C extensions aren't compiled at all, ImportError would be
> raised earlier.

demandimport could be a source of (surprising) ImportErrors with 3rd-party
code. Like hgsubversion imports svn binding, while the binding does not
exist.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH 1 of 2] dispatch: move part of callcatch to scmutil

2016-11-24 Thread Yuya Nishihara
On Thu, 24 Nov 2016 01:17:49 +, Jun Wu wrote:
> # HG changeset patch
> # User Jun Wu 
> # Date 1479948520 0
> #  Thu Nov 24 00:48:40 2016 +
> # Node ID c76f0d4bdee6bfbd7bda771d5c05939d1d4cb132
> # Parent  7ef2ebf5cdf91192a66b461ff56f653a65e65dd7
> # Available At https://bitbucket.org/quark-zju/hg-draft
> #  hg pull https://bitbucket.org/quark-zju/hg-draft -r 
> c76f0d4bdee6
> dispatch: move part of callcatch to scmutil

Queued these, thanks.

> -except ImportError as inst:
> -ui.warn(_("abort: %s!\n") % inst)
> -m = str(inst).split()[-1]
> -if m in "mpatch bdiff".split():
> -ui.warn(_("(did you forget to compile extensions?)\n"))
> -elif m in "zlib".split():
> -ui.warn(_("(is your Python install correct?)\n"))

This seems better belonging to the high-level callcatch(), but anyway it looks
like a moot. If C extensions aren't compiled at all, ImportError would be
raised earlier.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH 1 of 2] dispatch: move part of callcatch to scmutil

2016-11-23 Thread Jun Wu
That's an interesting idea.

I happened to be interested in the diff algorithm recently and think they
are related. A fundamental problem of the diff algorithm is, it does not
track line moves. As long as our diff algorithm cannot do that, I won't do
the merge thing manually.

Will that kind of "smart" diff algorithm exist? Probably. And if we can have
the diff algorithm which detects moves (I'm in dreaming mode), and new
version of revlog (probably will contain both the new diff algorithm, and
some kind of packing to reduce inode), it will help making deltas smaller.

And I don't think the "move" information has to be hashed / committed. It
could be calculated afterwards and store separately. (this also means I
think the git data model is cleaner). 

Excerpts from timeless's message of 2016-11-23 21:36:02 -0500:
> fwiw, it is possible to keep blame for this if you really wanted to.
> 
> The approach is:
> 7ef2ebf5cdf91192a66b461ff56f653a65e65dd7->x
> x:
>  copy scmutil.py -> scmutil_.py
> 7ef2ebf5cdf91192a66b461ff56f653a65e65dd7->y
> y:
>  copy dispatch.py-> scmutil_.py
>  delete lines from scmutil_.py
> 
> x+y->z
> z:
>  resolve merge conflicts in scmutil_.py as in this patch
>  delete scmutil.py
>  rename scmutil_.py -> scmutil.py
>  delete lines from dispatch.py
>  adjust dispatch.py as in this patch
> 
> If you do it this way, commits `x` and `y` still build (they just have
> temporary files scmutil_.py which isn't used), and you still have
> blame for scmutil.py for both parts.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH 1 of 2] dispatch: move part of callcatch to scmutil

2016-11-23 Thread timeless
fwiw, it is possible to keep blame for this if you really wanted to.

The approach is:
7ef2ebf5cdf91192a66b461ff56f653a65e65dd7->x
x:
 copy scmutil.py -> scmutil_.py
7ef2ebf5cdf91192a66b461ff56f653a65e65dd7->y
y:
 copy dispatch.py-> scmutil_.py
 delete lines from scmutil_.py

x+y->z
z:
 resolve merge conflicts in scmutil_.py as in this patch
 delete scmutil.py
 rename scmutil_.py -> scmutil.py
 delete lines from dispatch.py
 adjust dispatch.py as in this patch

If you do it this way, commits `x` and `y` still build (they just have
temporary files scmutil_.py which isn't used), and you still have
blame for scmutil.py for both parts.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel