[PATCH 1 of 2 RFC V2] largefiles: abort push on client when file fit largefiles (issue3245)

Yuya Nishihara yuya at tcha.org
Fri Sep 2 15:38:26 UTC 2016


On Fri, 2 Sep 2016 09:12:34 +0200, Piotr Listkiewicz wrote:
> > I don't have any better idea, but I think it's too late to exchange minsize
> > and patterns on push. Ideally these limits should be enforced when files
> > are
> > added or committed. In order to do that, these values have to be pulled
> > beforehand and cached somewhere.
> 
> When do You think these values have to be pulled? It can be done on clone,
> but then what about repositories that were cloned before?

On clone and pull, (and maybe on push?)

> Another thing is
> when those limits are enforced on add/commit, what about situation when
> user is working offline and those values are not cached.

Do add/commit with no limits. These local limits are advisory, they are
checked again by the server. My point is that unacceptable changes should
be warned as early as possible. Fixing a bunch of unpushable revisions would
waste time.

> Another
> complication when those values are enforced on add/commit and user have
> multiply push destination - if we decide to take size/patterns from one
> push destination we would prevent doing completely correct add/commit for
> another push destination. What if in the meantime those values are changed
> in push/pull destination repository?

Maybe we could trust the default peer? IIRC, largefiles tends to use
default/default-push if no peer path is available. Another idea is to
calculate the narrowest restrictions so changes can be pushed to all peers.

> What if a pattern contain ',' ?
> 
> Right, which character would be correct - semicolon or they should not be
> sent as plain text?

That could be encoded to a text or packed into a binary-safe frame?
(I don't know the detail of the wire protocol.)

> Falling back to all() would be too expensive. Perhaps we can use
> > prepushoutgoinghooks.
> 
> In pushoperation class self.revs comments states that 'None is all' - in
> this situation it is not correct to check all revs?

All outgoing revisions need to be checked. It would be unacceptable cost
to scan all revisions every time you do "hg push".


More information about the Mercurial-devel mailing list