[PATCH] subrepo: avoids empty commit when .hgsubstate is dirty (issue2403)
ez at aragost.com
Fri Dec 17 05:59:09 CST 2010
fre, 17 12 2010 kl. 12:18 +0100, skrev Mads Kiilerich:
> On 12/17/2010 11:53 AM, Erik Zielke wrote:
> > fre, 17 12 2010 kl. 11:18 +0100, skrev Mads Kiilerich:
> >> It seems to me like a proper fix requires some refactoring of the commit
> >> function. We basically don't know the state of the outer repo before we
> >> have done the recursive commit, so we have to do the recursive commit
> >> before we can create the commit context (which we however use for the
> >> recursive commit).
> > So you think that it should just be backed out for now and then prevent
> > such empty commits somewhat differently, right?
> I worked enough with this issue to know what didn't work for me, but I
> gave up because I couldn't see any good solutions.
> But it seems like the annoyance fix introduced a more serious bug, so I
> think it either should be fixed or backed out.
Yes, I am sorry.
> > Although something like the following will fix the issue you pointed
> > out:
> > for newstate in state:
> > if state[newstate] != pstate[newstate]:
> > changed = True
> > - if changed:
> > - subrepo.writestate(self, state)
> > - elif (changes == ['.hgsubstate'] and changes ==
> >  and
> > + subrepo.writestate(self, state)
> > + if (not changed and changes == ['.hgsubstate']
> > + and changes ==  and
> > changes == ):
> > return None
> That would bring us back to still making empty substate commits when
> there are other changes, right?
When there are other changes they would go into the commit and therefore
not empty, or am I misunderstanding something?
> I guess a good fix in this direction should remove .hgsubstate from
> changes if it is unchanged, and _then_ we can try to abort the commit
> if there is nothing left to commit ... unless we are in one of the
> situations where we really want to make an empty commit.
More information about the Mercurial-devel