Bug 3935 - Locally cloning a repo with hidden revisions makes those revisions not hidden
Summary: Locally cloning a repo with hidden revisions makes those revisions not hidden
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: evolution (show other bugs)
Version: 2.6
Hardware: PC Windows
: normal bug
Assignee: Pierre-Yves David
URL:
Keywords: easy
: 4156 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-05-14 10:34 UTC by Angel Ezquerra
Modified: 2014-07-19 14:17 UTC (History)
5 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 Angel Ezquerra 2013-05-14 10:34 UTC
On Windows, with the evolution extension enabled, if you clone a repository that has hidden revisions, those hidden revisions become not hidden on the cloned repository.

This is a small test case that shows the problem:

E:\repos>hg.exe --version
Mercurial Distributed SCM (version 2.6)
(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.
E:\repos>mkdir test
E:\repos>cd test
E:\repos\test>hg.exe init
E:\repos\test>echo foo>foo.txt
E:\repos\test>hg.exe add foo.txt
E:\repos\test>hg.exe commit -m "first revision"
E:\repos\test>echo bar>foo.txt
E:\repos\test>hg.exe commit --amend -m "amended first revision"
E:\repos\test>hg.exe clone . ..\test_clone
updating to branch default
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
E:\repos\test>cd ..\test_clone
E:\repos\test>hg.exe log -G
@  changeset:   2:242d2167c5b9
   tag:         tip
   parent:      -1:000000000000
   user:        ezquerra
   date:        Tue May 14 13:51:10 2013 +0200
   summary:     amended first revision

o  changeset:   1:2542378113ab
|  user:        ezquerra
|  date:        Tue May 14 13:51:10 2013 +0200
|  summary:     temporary amend commit for c2b18fa958eb
|
o  changeset:   0:c2b18fa958eb
   user:        ezquerra
   date:        Tue May 14 13:51:10 2013 +0200
   summary:     first revision

Note how I did not use --hidden when calling "hg.exe log -G".
Comment 1 Augie Fackler 2013-05-16 22:38 UTC
This is surprising behavior triggered by [phases]publish=no not being set globally IIRC. I ran into this a couple of days ago as well.
Comment 2 Pierre-Yves David 2013-05-21 04:36 UTC
Yes, the local clone includes hidden revision too (because it is faster and does not hurt) But it then turns all cloned revision public including the hidden one. That a but.
Comment 3 Giovanni Gherdovich 2014-01-29 17:39 UTC
*** Bug 4156 has been marked as a duplicate of this bug. ***
Comment 4 HG Bot 2014-01-30 16:00 UTC
Fixed by http://selenic.com/repo/hg/rev/a959f7167077
Pierre-Yves David <pierre-yves.david@logilab.fr>
clone: do not turn hidden changeset public on publishing clone (issue3935)

Before this changeset local clone of a repo with hidden changeset would include
then in the clone (why not) and turn them public (plain wrong). This happened
because the copy clone publish by dropping the phaseroot file entirely making
everything in the repo public (and therefore immune to obsolescence marker).

This changeset takes the simplest fix, we deny the copy clone in the case of hidden
changeset falling back to pull clone that will exclude them from the clone and
therefore not turning them public.

A smarter version of copy clone could be done, but I prefer to go for the
simplest solution first.

(please test the fix)