EOL extension

timeless timeless at gmail.com
Tue Dec 1 17:14:33 CST 2009


On Tue, Dec 1, 2009 at 11:35 PM, Paul Moore <p.f.moore at gmail.com> wrote:
> I doubt that mandating use of mq will work. I'm not sure if you are
> mandating mq, or just using it as an example, but I'd probably
> understand your suggestion better if you used core Mercurial commands.

sorry. it's not worth my time. please insert 50c

> # first victim

hg clone -r `hg parents -r first_bad` clean_repo

rev = first_bad
loop:
 hg export -r $rev | hg import --no-commit -R clean_repo -
 fix-line-endings
 hg commit --user -m `hg log -r $rev --template="{desc}"` -u `hg log
-r $rev --template="{author}"` -R clean_repo
 rev = $($rev + 1)
 [ $rev le tip ] && goto loop

> I'm in agreement with Mark (I think! I may have misunderstood his point) that

> 1. Server-side hooks won't work, as I could commit all sorts of damage
> locally and then push, and even if the final result is clean, there
> could be any amount of clutter in between. Or would the server side
> hook stop the intermediate csets?

That's the point, the hook would reject the whole set. Nothing would
reach the upstream repository.

> If so, I could have work that I
> couldn't push without rewriting my local history. That's nasty. (Is
> that why you need mq above?)

That's the general idea, yes. Either it's ok to have garbage in the
repo, or not.

> 2. Commits to fix EOL breakage are icky. Not least because diffs that
> show lines changing but the only change is to EOL format are also
> icky. Let's aim to avoid EOL breakage getting into the repo in the
> first place.

Right. You can do this by having the same precommit hooks that the
upstream repo has.

> It seems to me that the extension (as described in its documentation -
> I haven't tried it) does what is needed for most usages.

I'm only explaining how the repository could be configured and what
people would have to do if it were configured this way.

> By the way, I'm a Windows developer, but the code I work on generally
> only has me as developer, and I don't hit these types of issues.

I do work on lots of platforms (including Windows). I encounter these
sorts of problems when certain strange things happen, usually other
people, but historically some versions of patch on other platforms.


More information about the Mercurial-devel mailing list