[PATCH] bundle: warn when update to revision existing only in a bundle (issue5004)

Piotr Listkiewicz piotr.listkiewicz at gmail.com
Mon Mar 28 08:23:13 EDT 2016


>
> > +        if p2 and p2 not in nodemap:
> > +            self.ui.warn(_("setting parent to node %s non-existing "
> > +                           "in the local repository\n")
> > +                         % nodemod.hex(p2))
> Maybe this should be an 'elif'.


Good point, the question is if it should raise two warning messages if both
parents doesnt exist or not. In Patch V2 I preserve this patch behaviour,
but im still looking forward what others think about it.

2016-03-24 19:21 GMT+01:00 Sean Farley <sean at farley.io>:

>
> liscju <piotr.listkiewicz at gmail.com> writes:
>
> > # HG changeset patch
> > # User liscju <piotr.listkiewicz at gmail.com>
> > # Date 1458719722 -3600
> > #      Wed Mar 23 08:55:22 2016 +0100
> > # Node ID 54c0e66ee49f08806488a591f32fa18581fde717
> > # Parent  78e4e558fa74aa4489609953328cbcecf1a8a428
> > bundle: warn when update to revision existing only in a bundle
> (issue5004)
> >
> > Now its done silently, so unless user really knows what he is doing
> > will be suprised to find that after update 'hg status' doesn't work.
>
> Nice idea. I like idea. Only nit-picks below.
>
> > diff -r 78e4e558fa74 -r 54c0e66ee49f mercurial/bundlerepo.py
> > --- a/mercurial/bundlerepo.py Sat Mar 19 08:27:54 2016 -0700
> > +++ b/mercurial/bundlerepo.py Wed Mar 23 08:55:22 2016 +0100
> > @@ -32,6 +32,7 @@ from . import (
> >      localrepo,
> >      manifest,
> >      mdiff,
> > +    node as nodemod,
> >      pathutil,
> >      phases,
> >      revlog,
> > @@ -385,6 +386,18 @@ class bundlerepository(localrepo.localre
> >      def getcwd(self):
> >          return os.getcwd() # always outside the repo
> >
> > +    def setparents(self, p1, p2=nullid):
> > +        c = changelog.changelog(self.svfs)
> > +        nodemap = c.nodemap
> > +        if p1 not in nodemap:
> > +            self.ui.warn(_("setting parent to node %s non-existing "
> > +                           "in the local repository\n")
> > +                         % nodemod.hex(p1))
>
> We should probably bikeshed on the wording a little. Maybe something
> like:
>
> "updating to HEXNODE which does not exist in PATH/TO/REPO"
>
> I'm a little unsure how we should word the local repo.
>
> > +        if p2 and p2 not in nodemap:
> > +            self.ui.warn(_("setting parent to node %s non-existing "
> > +                           "in the local repository\n")
> > +                         % nodemod.hex(p2))
>
> Maybe this should be an 'elif'.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mercurial-scm.org/pipermail/mercurial-devel/attachments/20160328/b5973788/attachment-0001.html>


More information about the Mercurial-devel mailing list