Bug 3595 - regression : hg update --check
Summary: regression : hg update --check
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: Mercurial (show other bugs)
Version: earlier
Hardware: PC Linux
: urgent bug
Assignee: Bugzilla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-22 16:01 UTC by bdedardel
Modified: 2017-11-01 18:05 UTC (History)
4 users (show)

See Also:
Python Version: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description bdedardel 2012-08-22 16:01 UTC
Hi all,

I'm testing ant4hg project (http://ant4hg.free.fr/) with last release of hg.
This project have antunit tests to prevent regressions.

I notice different behavior between hg1.9.2 and hg2.3.
Is that a regression ?

Regards,
Benjamin

===== mercurial V1.9.2 =====
$ hg version
Mercurial Distributed SCM (version 1.9.2)
(see http://mercurial.selenic.com for more information)

Copyright (C) 2005-2011 Matt Mackall and others
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ hg init
$ touch file1A.txt
$ hg add file1A.txt
$ hg commit -m 'test'
$ hg help commit
$ hg commit -m 'test' -u 'bdd'
$ rm file1A.txt
$ hg update -c
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ ls
file1A.txt

===== mercurial V2.3 (which does not print version !) =====
$ hg version
Mercurial Distributed SCM (version unknown)
(see http://mercurial.selenic.com for more information)

Copyright (C) 2005-2012 Matt Mackall and others
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ hg init
$ touch file1A.txt
$ hg add file1A.txt
$ hg commit -m 'test'
$ hg help commit
$ hg commit -m 'test' -u 'bdd'
$ rm file1A.txt
$ hg update -c
0 files updated, 0 files merged, 0 files removed, 0 files unresolved

---------------------------------------------------------------
On Wed, 2012-08-22 at 10:57 +0200, Mads Kiilerich wrote:
> On 22/08/12 06:32, ant4hg wrote:
> > I notice different behavior between hg1.9.2 and hg2.3.
>
>    $ hg init
>    $ touch file1A.txt
>    $ hg add file1A.txt
>    $ hg commit -m 'test'
>    $ rm file1A.txt
>    $ hg update -c
>    1 files updated, 0 files merged, 0 files removed, 0 files unresolved
>    $ ls
>    file1A.txt
>
> > Is that a regression ?
>
> It is an unannounced behavioural change introduced in
> http://selenic.com/repo/hg/rev/914bc95e227b and released in 2.2. I looks
> like a regression.

Indeed.

> I guess someone will pick it up from here and fix it, but filing it in
> the bug tracker would be better.

If the default someone is presumed to be me, then yes, it definitely
needs to go in the BTS to not be forgotten, given my current backlog.
Comment 1 David Soria Parra 2012-10-01 08:10 UTC
I bisected it to

changeset:   16092:914bc95e227b
parent:      16090:e1d8218d733b
user:        Matt Mackall <mpm@selenic.com>
date:        Thu Feb 09 13:16:20 2012 -0600
summary:     update: use normal update path with --check (issue2450)

I am not sure if it's a regression bug. You update to a descendant of the current working directories parent. --check should not be necessary. hg update without -c doesn't recreate the fileA.txt. Your experienced behavior in 1.9.2 is probably related to issue 2450.
Comment 2 HG Bot 2012-10-22 19:13 UTC
Fixed by http://selenic.com/repo/hg/rev/6da47b655d97
Matt Mackall <mpm@selenic.com>
update: check for missing files with --check (issue3595)

(please test the fix)