##// END OF EJS Templates
repoview: add non-global tags to candidate list for blocking hidden changesets...
Sean Farley -
r20807:91d28bd0 default
parent child Browse files
Show More
@@ -1,213 +1,216 b''
1 # repoview.py - Filtered view of a localrepo object
1 # repoview.py - Filtered view of a localrepo object
2 #
2 #
3 # Copyright 2012 Pierre-Yves David <pierre-yves.david@ens-lyon.org>
3 # Copyright 2012 Pierre-Yves David <pierre-yves.david@ens-lyon.org>
4 # Logilab SA <contact@logilab.fr>
4 # Logilab SA <contact@logilab.fr>
5 #
5 #
6 # This software may be used and distributed according to the terms of the
6 # This software may be used and distributed according to the terms of the
7 # GNU General Public License version 2 or any later version.
7 # GNU General Public License version 2 or any later version.
8
8
9 import copy
9 import copy
10 import phases
10 import phases
11 import util
11 import util
12 import obsolete
12 import obsolete
13
13
14
14
15 def hideablerevs(repo):
15 def hideablerevs(repo):
16 """Revisions candidates to be hidden
16 """Revisions candidates to be hidden
17
17
18 This is a standalone function to help extensions to wrap it."""
18 This is a standalone function to help extensions to wrap it."""
19 return obsolete.getrevs(repo, 'obsolete')
19 return obsolete.getrevs(repo, 'obsolete')
20
20
21 def computehidden(repo):
21 def computehidden(repo):
22 """compute the set of hidden revision to filter
22 """compute the set of hidden revision to filter
23
23
24 During most operation hidden should be filtered."""
24 During most operation hidden should be filtered."""
25 assert not repo.changelog.filteredrevs
25 assert not repo.changelog.filteredrevs
26 hideable = hideablerevs(repo)
26 hideable = hideablerevs(repo)
27 if hideable:
27 if hideable:
28 cl = repo.changelog
28 cl = repo.changelog
29 firsthideable = min(hideable)
29 firsthideable = min(hideable)
30 revs = cl.revs(start=firsthideable)
30 revs = cl.revs(start=firsthideable)
31 tofilter = repo.revs(
31 tofilter = repo.revs(
32 '(%ld) and children(%ld)', list(revs), list(hideable))
32 '(%ld) and children(%ld)', list(revs), list(hideable))
33 blockers = [r for r in tofilter if r not in hideable]
33 blockers = [r for r in tofilter if r not in hideable]
34 for par in repo[None].parents():
34 for par in repo[None].parents():
35 blockers.append(par.rev())
35 blockers.append(par.rev())
36 for bm in repo._bookmarks.values():
36 for bm in repo._bookmarks.values():
37 blockers.append(repo[bm].rev())
37 blockers.append(repo[bm].rev())
38 tags = [n for t, n in repo.tags().iteritems()
39 if (repo.tagtype(t) and repo.tagtype(t) != 'global')]
40 blockers.extend(repo[t].rev() for t in tags)
38 blocked = cl.ancestors(blockers, inclusive=True)
41 blocked = cl.ancestors(blockers, inclusive=True)
39 return frozenset(r for r in hideable if r not in blocked)
42 return frozenset(r for r in hideable if r not in blocked)
40 return frozenset()
43 return frozenset()
41
44
42 def computeunserved(repo):
45 def computeunserved(repo):
43 """compute the set of revision that should be filtered when used a server
46 """compute the set of revision that should be filtered when used a server
44
47
45 Secret and hidden changeset should not pretend to be here."""
48 Secret and hidden changeset should not pretend to be here."""
46 assert not repo.changelog.filteredrevs
49 assert not repo.changelog.filteredrevs
47 # fast path in simple case to avoid impact of non optimised code
50 # fast path in simple case to avoid impact of non optimised code
48 hiddens = filterrevs(repo, 'visible')
51 hiddens = filterrevs(repo, 'visible')
49 if phases.hassecret(repo):
52 if phases.hassecret(repo):
50 cl = repo.changelog
53 cl = repo.changelog
51 secret = phases.secret
54 secret = phases.secret
52 getphase = repo._phasecache.phase
55 getphase = repo._phasecache.phase
53 first = min(cl.rev(n) for n in repo._phasecache.phaseroots[secret])
56 first = min(cl.rev(n) for n in repo._phasecache.phaseroots[secret])
54 revs = cl.revs(start=first)
57 revs = cl.revs(start=first)
55 secrets = set(r for r in revs if getphase(repo, r) >= secret)
58 secrets = set(r for r in revs if getphase(repo, r) >= secret)
56 return frozenset(hiddens | secrets)
59 return frozenset(hiddens | secrets)
57 else:
60 else:
58 return hiddens
61 return hiddens
59
62
60 def computemutable(repo):
63 def computemutable(repo):
61 """compute the set of revision that should be filtered when used a server
64 """compute the set of revision that should be filtered when used a server
62
65
63 Secret and hidden changeset should not pretend to be here."""
66 Secret and hidden changeset should not pretend to be here."""
64 assert not repo.changelog.filteredrevs
67 assert not repo.changelog.filteredrevs
65 # fast check to avoid revset call on huge repo
68 # fast check to avoid revset call on huge repo
66 if util.any(repo._phasecache.phaseroots[1:]):
69 if util.any(repo._phasecache.phaseroots[1:]):
67 getphase = repo._phasecache.phase
70 getphase = repo._phasecache.phase
68 maymutable = filterrevs(repo, 'base')
71 maymutable = filterrevs(repo, 'base')
69 return frozenset(r for r in maymutable if getphase(repo, r))
72 return frozenset(r for r in maymutable if getphase(repo, r))
70 return frozenset()
73 return frozenset()
71
74
72 def computeimpactable(repo):
75 def computeimpactable(repo):
73 """Everything impactable by mutable revision
76 """Everything impactable by mutable revision
74
77
75 The immutable filter still have some chance to get invalidated. This will
78 The immutable filter still have some chance to get invalidated. This will
76 happen when:
79 happen when:
77
80
78 - you garbage collect hidden changeset,
81 - you garbage collect hidden changeset,
79 - public phase is moved backward,
82 - public phase is moved backward,
80 - something is changed in the filtering (this could be fixed)
83 - something is changed in the filtering (this could be fixed)
81
84
82 This filter out any mutable changeset and any public changeset that may be
85 This filter out any mutable changeset and any public changeset that may be
83 impacted by something happening to a mutable revision.
86 impacted by something happening to a mutable revision.
84
87
85 This is achieved by filtered everything with a revision number egal or
88 This is achieved by filtered everything with a revision number egal or
86 higher than the first mutable changeset is filtered."""
89 higher than the first mutable changeset is filtered."""
87 assert not repo.changelog.filteredrevs
90 assert not repo.changelog.filteredrevs
88 cl = repo.changelog
91 cl = repo.changelog
89 firstmutable = len(cl)
92 firstmutable = len(cl)
90 for roots in repo._phasecache.phaseroots[1:]:
93 for roots in repo._phasecache.phaseroots[1:]:
91 if roots:
94 if roots:
92 firstmutable = min(firstmutable, min(cl.rev(r) for r in roots))
95 firstmutable = min(firstmutable, min(cl.rev(r) for r in roots))
93 # protect from nullrev root
96 # protect from nullrev root
94 firstmutable = max(0, firstmutable)
97 firstmutable = max(0, firstmutable)
95 return frozenset(xrange(firstmutable, len(cl)))
98 return frozenset(xrange(firstmutable, len(cl)))
96
99
97 # function to compute filtered set
100 # function to compute filtered set
98 #
101 #
99 # When adding a new filter you MUST update the table at:
102 # When adding a new filter you MUST update the table at:
100 # mercurial.branchmap.subsettable
103 # mercurial.branchmap.subsettable
101 # Otherwise your filter will have to recompute all its branches cache
104 # Otherwise your filter will have to recompute all its branches cache
102 # from scratch (very slow).
105 # from scratch (very slow).
103 filtertable = {'visible': computehidden,
106 filtertable = {'visible': computehidden,
104 'served': computeunserved,
107 'served': computeunserved,
105 'immutable': computemutable,
108 'immutable': computemutable,
106 'base': computeimpactable}
109 'base': computeimpactable}
107
110
108 def filterrevs(repo, filtername):
111 def filterrevs(repo, filtername):
109 """returns set of filtered revision for this filter name"""
112 """returns set of filtered revision for this filter name"""
110 if filtername not in repo.filteredrevcache:
113 if filtername not in repo.filteredrevcache:
111 func = filtertable[filtername]
114 func = filtertable[filtername]
112 repo.filteredrevcache[filtername] = func(repo.unfiltered())
115 repo.filteredrevcache[filtername] = func(repo.unfiltered())
113 return repo.filteredrevcache[filtername]
116 return repo.filteredrevcache[filtername]
114
117
115 class repoview(object):
118 class repoview(object):
116 """Provide a read/write view of a repo through a filtered changelog
119 """Provide a read/write view of a repo through a filtered changelog
117
120
118 This object is used to access a filtered version of a repository without
121 This object is used to access a filtered version of a repository without
119 altering the original repository object itself. We can not alter the
122 altering the original repository object itself. We can not alter the
120 original object for two main reasons:
123 original object for two main reasons:
121 - It prevents the use of a repo with multiple filters at the same time. In
124 - It prevents the use of a repo with multiple filters at the same time. In
122 particular when multiple threads are involved.
125 particular when multiple threads are involved.
123 - It makes scope of the filtering harder to control.
126 - It makes scope of the filtering harder to control.
124
127
125 This object behaves very closely to the original repository. All attribute
128 This object behaves very closely to the original repository. All attribute
126 operations are done on the original repository:
129 operations are done on the original repository:
127 - An access to `repoview.someattr` actually returns `repo.someattr`,
130 - An access to `repoview.someattr` actually returns `repo.someattr`,
128 - A write to `repoview.someattr` actually sets value of `repo.someattr`,
131 - A write to `repoview.someattr` actually sets value of `repo.someattr`,
129 - A deletion of `repoview.someattr` actually drops `someattr`
132 - A deletion of `repoview.someattr` actually drops `someattr`
130 from `repo.__dict__`.
133 from `repo.__dict__`.
131
134
132 The only exception is the `changelog` property. It is overridden to return
135 The only exception is the `changelog` property. It is overridden to return
133 a (surface) copy of `repo.changelog` with some revisions filtered. The
136 a (surface) copy of `repo.changelog` with some revisions filtered. The
134 `filtername` attribute of the view control the revisions that need to be
137 `filtername` attribute of the view control the revisions that need to be
135 filtered. (the fact the changelog is copied is an implementation detail).
138 filtered. (the fact the changelog is copied is an implementation detail).
136
139
137 Unlike attributes, this object intercepts all method calls. This means that
140 Unlike attributes, this object intercepts all method calls. This means that
138 all methods are run on the `repoview` object with the filtered `changelog`
141 all methods are run on the `repoview` object with the filtered `changelog`
139 property. For this purpose the simple `repoview` class must be mixed with
142 property. For this purpose the simple `repoview` class must be mixed with
140 the actual class of the repository. This ensures that the resulting
143 the actual class of the repository. This ensures that the resulting
141 `repoview` object have the very same methods than the repo object. This
144 `repoview` object have the very same methods than the repo object. This
142 leads to the property below.
145 leads to the property below.
143
146
144 repoview.method() --> repo.__class__.method(repoview)
147 repoview.method() --> repo.__class__.method(repoview)
145
148
146 The inheritance has to be done dynamically because `repo` can be of any
149 The inheritance has to be done dynamically because `repo` can be of any
147 subclasses of `localrepo`. Eg: `bundlerepo` or `statichttprepo`.
150 subclasses of `localrepo`. Eg: `bundlerepo` or `statichttprepo`.
148 """
151 """
149
152
150 def __init__(self, repo, filtername):
153 def __init__(self, repo, filtername):
151 object.__setattr__(self, '_unfilteredrepo', repo)
154 object.__setattr__(self, '_unfilteredrepo', repo)
152 object.__setattr__(self, 'filtername', filtername)
155 object.__setattr__(self, 'filtername', filtername)
153 object.__setattr__(self, '_clcachekey', None)
156 object.__setattr__(self, '_clcachekey', None)
154 object.__setattr__(self, '_clcache', None)
157 object.__setattr__(self, '_clcache', None)
155
158
156 # not a propertycache on purpose we shall implement a proper cache later
159 # not a propertycache on purpose we shall implement a proper cache later
157 @property
160 @property
158 def changelog(self):
161 def changelog(self):
159 """return a filtered version of the changeset
162 """return a filtered version of the changeset
160
163
161 this changelog must not be used for writing"""
164 this changelog must not be used for writing"""
162 # some cache may be implemented later
165 # some cache may be implemented later
163 unfi = self._unfilteredrepo
166 unfi = self._unfilteredrepo
164 unfichangelog = unfi.changelog
167 unfichangelog = unfi.changelog
165 revs = filterrevs(unfi, self.filtername)
168 revs = filterrevs(unfi, self.filtername)
166 cl = self._clcache
169 cl = self._clcache
167 newkey = (len(unfichangelog), unfichangelog.tip(), hash(revs))
170 newkey = (len(unfichangelog), unfichangelog.tip(), hash(revs))
168 if cl is not None:
171 if cl is not None:
169 # we need to check curkey too for some obscure reason.
172 # we need to check curkey too for some obscure reason.
170 # MQ test show a corruption of the underlying repo (in _clcache)
173 # MQ test show a corruption of the underlying repo (in _clcache)
171 # without change in the cachekey.
174 # without change in the cachekey.
172 oldfilter = cl.filteredrevs
175 oldfilter = cl.filteredrevs
173 try:
176 try:
174 cl.filterrevs = () # disable filtering for tip
177 cl.filterrevs = () # disable filtering for tip
175 curkey = (len(cl), cl.tip(), hash(oldfilter))
178 curkey = (len(cl), cl.tip(), hash(oldfilter))
176 finally:
179 finally:
177 cl.filteredrevs = oldfilter
180 cl.filteredrevs = oldfilter
178 if newkey != self._clcachekey or newkey != curkey:
181 if newkey != self._clcachekey or newkey != curkey:
179 cl = None
182 cl = None
180 # could have been made None by the previous if
183 # could have been made None by the previous if
181 if cl is None:
184 if cl is None:
182 cl = copy.copy(unfichangelog)
185 cl = copy.copy(unfichangelog)
183 cl.filteredrevs = revs
186 cl.filteredrevs = revs
184 object.__setattr__(self, '_clcache', cl)
187 object.__setattr__(self, '_clcache', cl)
185 object.__setattr__(self, '_clcachekey', newkey)
188 object.__setattr__(self, '_clcachekey', newkey)
186 return cl
189 return cl
187
190
188 def unfiltered(self):
191 def unfiltered(self):
189 """Return an unfiltered version of a repo"""
192 """Return an unfiltered version of a repo"""
190 return self._unfilteredrepo
193 return self._unfilteredrepo
191
194
192 def filtered(self, name):
195 def filtered(self, name):
193 """Return a filtered version of a repository"""
196 """Return a filtered version of a repository"""
194 if name == self.filtername:
197 if name == self.filtername:
195 return self
198 return self
196 return self.unfiltered().filtered(name)
199 return self.unfiltered().filtered(name)
197
200
198 # everything access are forwarded to the proxied repo
201 # everything access are forwarded to the proxied repo
199 def __getattr__(self, attr):
202 def __getattr__(self, attr):
200 return getattr(self._unfilteredrepo, attr)
203 return getattr(self._unfilteredrepo, attr)
201
204
202 def __setattr__(self, attr, value):
205 def __setattr__(self, attr, value):
203 return setattr(self._unfilteredrepo, attr, value)
206 return setattr(self._unfilteredrepo, attr, value)
204
207
205 def __delattr__(self, attr):
208 def __delattr__(self, attr):
206 return delattr(self._unfilteredrepo, attr)
209 return delattr(self._unfilteredrepo, attr)
207
210
208 # The `requirements` attribute is initialized during __init__. But
211 # The `requirements` attribute is initialized during __init__. But
209 # __getattr__ won't be called as it also exists on the class. We need
212 # __getattr__ won't be called as it also exists on the class. We need
210 # explicit forwarding to main repo here
213 # explicit forwarding to main repo here
211 @property
214 @property
212 def requirements(self):
215 def requirements(self):
213 return self._unfilteredrepo.requirements
216 return self._unfilteredrepo.requirements
@@ -1,887 +1,903 b''
1 $ cat >> $HGRCPATH << EOF
1 $ cat >> $HGRCPATH << EOF
2 > [phases]
2 > [phases]
3 > # public changeset are not obsolete
3 > # public changeset are not obsolete
4 > publish=false
4 > publish=false
5 > EOF
5 > EOF
6 $ mkcommit() {
6 $ mkcommit() {
7 > echo "$1" > "$1"
7 > echo "$1" > "$1"
8 > hg add "$1"
8 > hg add "$1"
9 > hg ci -m "add $1"
9 > hg ci -m "add $1"
10 > }
10 > }
11 $ getid() {
11 $ getid() {
12 > hg id --debug --hidden -ir "desc('$1')"
12 > hg id --debug --hidden -ir "desc('$1')"
13 > }
13 > }
14
14
15 $ cat > debugkeys.py <<EOF
15 $ cat > debugkeys.py <<EOF
16 > def reposetup(ui, repo):
16 > def reposetup(ui, repo):
17 > class debugkeysrepo(repo.__class__):
17 > class debugkeysrepo(repo.__class__):
18 > def listkeys(self, namespace):
18 > def listkeys(self, namespace):
19 > ui.write('listkeys %s\n' % (namespace,))
19 > ui.write('listkeys %s\n' % (namespace,))
20 > return super(debugkeysrepo, self).listkeys(namespace)
20 > return super(debugkeysrepo, self).listkeys(namespace)
21 >
21 >
22 > if repo.local():
22 > if repo.local():
23 > repo.__class__ = debugkeysrepo
23 > repo.__class__ = debugkeysrepo
24 > EOF
24 > EOF
25
25
26 $ hg init tmpa
26 $ hg init tmpa
27 $ cd tmpa
27 $ cd tmpa
28 $ mkcommit kill_me
28 $ mkcommit kill_me
29
29
30 Checking that the feature is properly disabled
30 Checking that the feature is properly disabled
31
31
32 $ hg debugobsolete -d '0 0' `getid kill_me` -u babar
32 $ hg debugobsolete -d '0 0' `getid kill_me` -u babar
33 abort: obsolete feature is not enabled on this repo
33 abort: obsolete feature is not enabled on this repo
34 [255]
34 [255]
35
35
36 Enabling it
36 Enabling it
37
37
38 $ cat > ../obs.py << EOF
38 $ cat > ../obs.py << EOF
39 > import mercurial.obsolete
39 > import mercurial.obsolete
40 > mercurial.obsolete._enabled = True
40 > mercurial.obsolete._enabled = True
41 > EOF
41 > EOF
42 $ echo '[extensions]' >> $HGRCPATH
42 $ echo '[extensions]' >> $HGRCPATH
43 $ echo "obs=${TESTTMP}/obs.py" >> $HGRCPATH
43 $ echo "obs=${TESTTMP}/obs.py" >> $HGRCPATH
44
44
45 Killing a single changeset without replacement
45 Killing a single changeset without replacement
46
46
47 $ hg debugobsolete 0
47 $ hg debugobsolete 0
48 abort: changeset references must be full hexadecimal node identifiers
48 abort: changeset references must be full hexadecimal node identifiers
49 [255]
49 [255]
50 $ hg debugobsolete '00'
50 $ hg debugobsolete '00'
51 abort: changeset references must be full hexadecimal node identifiers
51 abort: changeset references must be full hexadecimal node identifiers
52 [255]
52 [255]
53 $ hg debugobsolete -d '0 0' `getid kill_me` -u babar
53 $ hg debugobsolete -d '0 0' `getid kill_me` -u babar
54 $ hg debugobsolete
54 $ hg debugobsolete
55 97b7c2d76b1845ed3eb988cd612611e72406cef0 0 {'date': '0 0', 'user': 'babar'}
55 97b7c2d76b1845ed3eb988cd612611e72406cef0 0 {'date': '0 0', 'user': 'babar'}
56
56
57 (test that mercurial is not confused)
57 (test that mercurial is not confused)
58
58
59 $ hg up null --quiet # having 0 as parent prevents it to be hidden
59 $ hg up null --quiet # having 0 as parent prevents it to be hidden
60 $ hg tip
60 $ hg tip
61 changeset: -1:000000000000
61 changeset: -1:000000000000
62 tag: tip
62 tag: tip
63 user:
63 user:
64 date: Thu Jan 01 00:00:00 1970 +0000
64 date: Thu Jan 01 00:00:00 1970 +0000
65
65
66 $ hg up --hidden tip --quiet
66 $ hg up --hidden tip --quiet
67 $ cd ..
67 $ cd ..
68
68
69 Killing a single changeset with replacement
69 Killing a single changeset with replacement
70
70
71 $ hg init tmpb
71 $ hg init tmpb
72 $ cd tmpb
72 $ cd tmpb
73 $ mkcommit a
73 $ mkcommit a
74 $ mkcommit b
74 $ mkcommit b
75 $ mkcommit original_c
75 $ mkcommit original_c
76 $ hg up "desc('b')"
76 $ hg up "desc('b')"
77 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
77 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
78 $ mkcommit new_c
78 $ mkcommit new_c
79 created new head
79 created new head
80 $ hg log -r 'hidden()' --template '{rev}:{node|short} {desc}\n' --hidden
80 $ hg log -r 'hidden()' --template '{rev}:{node|short} {desc}\n' --hidden
81 $ hg debugobsolete --flag 12 `getid original_c` `getid new_c` -d '56 12'
81 $ hg debugobsolete --flag 12 `getid original_c` `getid new_c` -d '56 12'
82 $ hg log -r 'hidden()' --template '{rev}:{node|short} {desc}\n' --hidden
82 $ hg log -r 'hidden()' --template '{rev}:{node|short} {desc}\n' --hidden
83 2:245bde4270cd add original_c
83 2:245bde4270cd add original_c
84 $ hg debugobsolete
84 $ hg debugobsolete
85 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
85 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
86
86
87 do it again (it read the obsstore before adding new changeset)
87 do it again (it read the obsstore before adding new changeset)
88
88
89 $ hg up '.^'
89 $ hg up '.^'
90 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
90 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
91 $ mkcommit new_2_c
91 $ mkcommit new_2_c
92 created new head
92 created new head
93 $ hg debugobsolete -d '1337 0' `getid new_c` `getid new_2_c`
93 $ hg debugobsolete -d '1337 0' `getid new_c` `getid new_2_c`
94 $ hg debugobsolete
94 $ hg debugobsolete
95 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
95 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
96 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
96 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
97
97
98 Register two markers with a missing node
98 Register two markers with a missing node
99
99
100 $ hg up '.^'
100 $ hg up '.^'
101 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
101 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
102 $ mkcommit new_3_c
102 $ mkcommit new_3_c
103 created new head
103 created new head
104 $ hg debugobsolete -d '1338 0' `getid new_2_c` 1337133713371337133713371337133713371337
104 $ hg debugobsolete -d '1338 0' `getid new_2_c` 1337133713371337133713371337133713371337
105 $ hg debugobsolete -d '1339 0' 1337133713371337133713371337133713371337 `getid new_3_c`
105 $ hg debugobsolete -d '1339 0' 1337133713371337133713371337133713371337 `getid new_3_c`
106 $ hg debugobsolete
106 $ hg debugobsolete
107 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
107 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
108 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
108 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
109 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
109 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
110 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
110 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
111
111
112 Refuse pathological nullid successors
112 Refuse pathological nullid successors
113 $ hg debugobsolete -d '9001 0' 1337133713371337133713371337133713371337 0000000000000000000000000000000000000000
113 $ hg debugobsolete -d '9001 0' 1337133713371337133713371337133713371337 0000000000000000000000000000000000000000
114 transaction abort!
114 transaction abort!
115 rollback completed
115 rollback completed
116 abort: bad obsolescence marker detected: invalid successors nullid
116 abort: bad obsolescence marker detected: invalid successors nullid
117 [255]
117 [255]
118
118
119 Check that graphlog detect that a changeset is obsolete:
119 Check that graphlog detect that a changeset is obsolete:
120
120
121 $ hg log -G
121 $ hg log -G
122 @ changeset: 5:5601fb93a350
122 @ changeset: 5:5601fb93a350
123 | tag: tip
123 | tag: tip
124 | parent: 1:7c3bad9141dc
124 | parent: 1:7c3bad9141dc
125 | user: test
125 | user: test
126 | date: Thu Jan 01 00:00:00 1970 +0000
126 | date: Thu Jan 01 00:00:00 1970 +0000
127 | summary: add new_3_c
127 | summary: add new_3_c
128 |
128 |
129 o changeset: 1:7c3bad9141dc
129 o changeset: 1:7c3bad9141dc
130 | user: test
130 | user: test
131 | date: Thu Jan 01 00:00:00 1970 +0000
131 | date: Thu Jan 01 00:00:00 1970 +0000
132 | summary: add b
132 | summary: add b
133 |
133 |
134 o changeset: 0:1f0dee641bb7
134 o changeset: 0:1f0dee641bb7
135 user: test
135 user: test
136 date: Thu Jan 01 00:00:00 1970 +0000
136 date: Thu Jan 01 00:00:00 1970 +0000
137 summary: add a
137 summary: add a
138
138
139
139
140 check that heads does not report them
140 check that heads does not report them
141
141
142 $ hg heads
142 $ hg heads
143 changeset: 5:5601fb93a350
143 changeset: 5:5601fb93a350
144 tag: tip
144 tag: tip
145 parent: 1:7c3bad9141dc
145 parent: 1:7c3bad9141dc
146 user: test
146 user: test
147 date: Thu Jan 01 00:00:00 1970 +0000
147 date: Thu Jan 01 00:00:00 1970 +0000
148 summary: add new_3_c
148 summary: add new_3_c
149
149
150 $ hg heads --hidden
150 $ hg heads --hidden
151 changeset: 5:5601fb93a350
151 changeset: 5:5601fb93a350
152 tag: tip
152 tag: tip
153 parent: 1:7c3bad9141dc
153 parent: 1:7c3bad9141dc
154 user: test
154 user: test
155 date: Thu Jan 01 00:00:00 1970 +0000
155 date: Thu Jan 01 00:00:00 1970 +0000
156 summary: add new_3_c
156 summary: add new_3_c
157
157
158 changeset: 4:ca819180edb9
158 changeset: 4:ca819180edb9
159 parent: 1:7c3bad9141dc
159 parent: 1:7c3bad9141dc
160 user: test
160 user: test
161 date: Thu Jan 01 00:00:00 1970 +0000
161 date: Thu Jan 01 00:00:00 1970 +0000
162 summary: add new_2_c
162 summary: add new_2_c
163
163
164 changeset: 3:cdbce2fbb163
164 changeset: 3:cdbce2fbb163
165 parent: 1:7c3bad9141dc
165 parent: 1:7c3bad9141dc
166 user: test
166 user: test
167 date: Thu Jan 01 00:00:00 1970 +0000
167 date: Thu Jan 01 00:00:00 1970 +0000
168 summary: add new_c
168 summary: add new_c
169
169
170 changeset: 2:245bde4270cd
170 changeset: 2:245bde4270cd
171 user: test
171 user: test
172 date: Thu Jan 01 00:00:00 1970 +0000
172 date: Thu Jan 01 00:00:00 1970 +0000
173 summary: add original_c
173 summary: add original_c
174
174
175
175
176
176
177 check that summary does not report them
177 check that summary does not report them
178
178
179 $ hg init ../sink
179 $ hg init ../sink
180 $ echo '[paths]' >> .hg/hgrc
180 $ echo '[paths]' >> .hg/hgrc
181 $ echo 'default=../sink' >> .hg/hgrc
181 $ echo 'default=../sink' >> .hg/hgrc
182 $ hg summary --remote
182 $ hg summary --remote
183 parent: 5:5601fb93a350 tip
183 parent: 5:5601fb93a350 tip
184 add new_3_c
184 add new_3_c
185 branch: default
185 branch: default
186 commit: (clean)
186 commit: (clean)
187 update: (current)
187 update: (current)
188 remote: 3 outgoing
188 remote: 3 outgoing
189
189
190 $ hg summary --remote --hidden
190 $ hg summary --remote --hidden
191 parent: 5:5601fb93a350 tip
191 parent: 5:5601fb93a350 tip
192 add new_3_c
192 add new_3_c
193 branch: default
193 branch: default
194 commit: (clean)
194 commit: (clean)
195 update: 3 new changesets, 4 branch heads (merge)
195 update: 3 new changesets, 4 branch heads (merge)
196 remote: 3 outgoing
196 remote: 3 outgoing
197
197
198 check that various commands work well with filtering
198 check that various commands work well with filtering
199
199
200 $ hg tip
200 $ hg tip
201 changeset: 5:5601fb93a350
201 changeset: 5:5601fb93a350
202 tag: tip
202 tag: tip
203 parent: 1:7c3bad9141dc
203 parent: 1:7c3bad9141dc
204 user: test
204 user: test
205 date: Thu Jan 01 00:00:00 1970 +0000
205 date: Thu Jan 01 00:00:00 1970 +0000
206 summary: add new_3_c
206 summary: add new_3_c
207
207
208 $ hg log -r 6
208 $ hg log -r 6
209 abort: unknown revision '6'!
209 abort: unknown revision '6'!
210 [255]
210 [255]
211 $ hg log -r 4
211 $ hg log -r 4
212 abort: unknown revision '4'!
212 abort: unknown revision '4'!
213 [255]
213 [255]
214
214
215 Check that public changeset are not accounted as obsolete:
215 Check that public changeset are not accounted as obsolete:
216
216
217 $ hg --hidden phase --public 2
217 $ hg --hidden phase --public 2
218 $ hg log -G
218 $ hg log -G
219 @ changeset: 5:5601fb93a350
219 @ changeset: 5:5601fb93a350
220 | tag: tip
220 | tag: tip
221 | parent: 1:7c3bad9141dc
221 | parent: 1:7c3bad9141dc
222 | user: test
222 | user: test
223 | date: Thu Jan 01 00:00:00 1970 +0000
223 | date: Thu Jan 01 00:00:00 1970 +0000
224 | summary: add new_3_c
224 | summary: add new_3_c
225 |
225 |
226 | o changeset: 2:245bde4270cd
226 | o changeset: 2:245bde4270cd
227 |/ user: test
227 |/ user: test
228 | date: Thu Jan 01 00:00:00 1970 +0000
228 | date: Thu Jan 01 00:00:00 1970 +0000
229 | summary: add original_c
229 | summary: add original_c
230 |
230 |
231 o changeset: 1:7c3bad9141dc
231 o changeset: 1:7c3bad9141dc
232 | user: test
232 | user: test
233 | date: Thu Jan 01 00:00:00 1970 +0000
233 | date: Thu Jan 01 00:00:00 1970 +0000
234 | summary: add b
234 | summary: add b
235 |
235 |
236 o changeset: 0:1f0dee641bb7
236 o changeset: 0:1f0dee641bb7
237 user: test
237 user: test
238 date: Thu Jan 01 00:00:00 1970 +0000
238 date: Thu Jan 01 00:00:00 1970 +0000
239 summary: add a
239 summary: add a
240
240
241
241
242 And that bumped changeset are detected
242 And that bumped changeset are detected
243 --------------------------------------
243 --------------------------------------
244
244
245 If we didn't filtered obsolete changesets out, 3 and 4 would show up too. Also
245 If we didn't filtered obsolete changesets out, 3 and 4 would show up too. Also
246 note that the bumped changeset (5:5601fb93a350) is not a direct successor of
246 note that the bumped changeset (5:5601fb93a350) is not a direct successor of
247 the public changeset
247 the public changeset
248
248
249 $ hg log --hidden -r 'bumped()'
249 $ hg log --hidden -r 'bumped()'
250 changeset: 5:5601fb93a350
250 changeset: 5:5601fb93a350
251 tag: tip
251 tag: tip
252 parent: 1:7c3bad9141dc
252 parent: 1:7c3bad9141dc
253 user: test
253 user: test
254 date: Thu Jan 01 00:00:00 1970 +0000
254 date: Thu Jan 01 00:00:00 1970 +0000
255 summary: add new_3_c
255 summary: add new_3_c
256
256
257
257
258 And that we can't push bumped changeset
258 And that we can't push bumped changeset
259
259
260 $ hg push ../tmpa -r 0 --force #(make repo related)
260 $ hg push ../tmpa -r 0 --force #(make repo related)
261 pushing to ../tmpa
261 pushing to ../tmpa
262 searching for changes
262 searching for changes
263 warning: repository is unrelated
263 warning: repository is unrelated
264 adding changesets
264 adding changesets
265 adding manifests
265 adding manifests
266 adding file changes
266 adding file changes
267 added 1 changesets with 1 changes to 1 files (+1 heads)
267 added 1 changesets with 1 changes to 1 files (+1 heads)
268 $ hg push ../tmpa
268 $ hg push ../tmpa
269 pushing to ../tmpa
269 pushing to ../tmpa
270 searching for changes
270 searching for changes
271 abort: push includes bumped changeset: 5601fb93a350!
271 abort: push includes bumped changeset: 5601fb93a350!
272 [255]
272 [255]
273
273
274 Fixing "bumped" situation
274 Fixing "bumped" situation
275 We need to create a clone of 5 and add a special marker with a flag
275 We need to create a clone of 5 and add a special marker with a flag
276
276
277 $ hg up '5^'
277 $ hg up '5^'
278 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
278 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
279 $ hg revert -ar 5
279 $ hg revert -ar 5
280 adding new_3_c
280 adding new_3_c
281 $ hg ci -m 'add n3w_3_c'
281 $ hg ci -m 'add n3w_3_c'
282 created new head
282 created new head
283 $ hg debugobsolete -d '1338 0' --flags 1 `getid new_3_c` `getid n3w_3_c`
283 $ hg debugobsolete -d '1338 0' --flags 1 `getid new_3_c` `getid n3w_3_c`
284 $ hg log -r 'bumped()'
284 $ hg log -r 'bumped()'
285 $ hg log -G
285 $ hg log -G
286 @ changeset: 6:6f9641995072
286 @ changeset: 6:6f9641995072
287 | tag: tip
287 | tag: tip
288 | parent: 1:7c3bad9141dc
288 | parent: 1:7c3bad9141dc
289 | user: test
289 | user: test
290 | date: Thu Jan 01 00:00:00 1970 +0000
290 | date: Thu Jan 01 00:00:00 1970 +0000
291 | summary: add n3w_3_c
291 | summary: add n3w_3_c
292 |
292 |
293 | o changeset: 2:245bde4270cd
293 | o changeset: 2:245bde4270cd
294 |/ user: test
294 |/ user: test
295 | date: Thu Jan 01 00:00:00 1970 +0000
295 | date: Thu Jan 01 00:00:00 1970 +0000
296 | summary: add original_c
296 | summary: add original_c
297 |
297 |
298 o changeset: 1:7c3bad9141dc
298 o changeset: 1:7c3bad9141dc
299 | user: test
299 | user: test
300 | date: Thu Jan 01 00:00:00 1970 +0000
300 | date: Thu Jan 01 00:00:00 1970 +0000
301 | summary: add b
301 | summary: add b
302 |
302 |
303 o changeset: 0:1f0dee641bb7
303 o changeset: 0:1f0dee641bb7
304 user: test
304 user: test
305 date: Thu Jan 01 00:00:00 1970 +0000
305 date: Thu Jan 01 00:00:00 1970 +0000
306 summary: add a
306 summary: add a
307
307
308
308
309
309
310
310
311 $ cd ..
311 $ cd ..
312
312
313 Exchange Test
313 Exchange Test
314 ============================
314 ============================
315
315
316 Destination repo does not have any data
316 Destination repo does not have any data
317 ---------------------------------------
317 ---------------------------------------
318
318
319 Simple incoming test
319 Simple incoming test
320
320
321 $ hg init tmpc
321 $ hg init tmpc
322 $ cd tmpc
322 $ cd tmpc
323 $ hg incoming ../tmpb
323 $ hg incoming ../tmpb
324 comparing with ../tmpb
324 comparing with ../tmpb
325 changeset: 0:1f0dee641bb7
325 changeset: 0:1f0dee641bb7
326 user: test
326 user: test
327 date: Thu Jan 01 00:00:00 1970 +0000
327 date: Thu Jan 01 00:00:00 1970 +0000
328 summary: add a
328 summary: add a
329
329
330 changeset: 1:7c3bad9141dc
330 changeset: 1:7c3bad9141dc
331 user: test
331 user: test
332 date: Thu Jan 01 00:00:00 1970 +0000
332 date: Thu Jan 01 00:00:00 1970 +0000
333 summary: add b
333 summary: add b
334
334
335 changeset: 2:245bde4270cd
335 changeset: 2:245bde4270cd
336 user: test
336 user: test
337 date: Thu Jan 01 00:00:00 1970 +0000
337 date: Thu Jan 01 00:00:00 1970 +0000
338 summary: add original_c
338 summary: add original_c
339
339
340 changeset: 6:6f9641995072
340 changeset: 6:6f9641995072
341 tag: tip
341 tag: tip
342 parent: 1:7c3bad9141dc
342 parent: 1:7c3bad9141dc
343 user: test
343 user: test
344 date: Thu Jan 01 00:00:00 1970 +0000
344 date: Thu Jan 01 00:00:00 1970 +0000
345 summary: add n3w_3_c
345 summary: add n3w_3_c
346
346
347
347
348 Try to pull markers
348 Try to pull markers
349 (extinct changeset are excluded but marker are pushed)
349 (extinct changeset are excluded but marker are pushed)
350
350
351 $ hg pull ../tmpb
351 $ hg pull ../tmpb
352 pulling from ../tmpb
352 pulling from ../tmpb
353 requesting all changes
353 requesting all changes
354 adding changesets
354 adding changesets
355 adding manifests
355 adding manifests
356 adding file changes
356 adding file changes
357 added 4 changesets with 4 changes to 4 files (+1 heads)
357 added 4 changesets with 4 changes to 4 files (+1 heads)
358 (run 'hg heads' to see heads, 'hg merge' to merge)
358 (run 'hg heads' to see heads, 'hg merge' to merge)
359 $ hg debugobsolete
359 $ hg debugobsolete
360 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
360 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
361 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
361 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
362 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
362 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
363 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
363 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
364 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 {'date': '1338 0', 'user': 'test'}
364 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 {'date': '1338 0', 'user': 'test'}
365
365
366 Rollback//Transaction support
366 Rollback//Transaction support
367
367
368 $ hg debugobsolete -d '1340 0' aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
368 $ hg debugobsolete -d '1340 0' aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
369 $ hg debugobsolete
369 $ hg debugobsolete
370 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
370 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
371 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
371 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
372 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
372 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
373 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
373 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
374 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 {'date': '1338 0', 'user': 'test'}
374 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 {'date': '1338 0', 'user': 'test'}
375 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 0 {'date': '1340 0', 'user': 'test'}
375 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 0 {'date': '1340 0', 'user': 'test'}
376 $ hg rollback -n
376 $ hg rollback -n
377 repository tip rolled back to revision 3 (undo debugobsolete)
377 repository tip rolled back to revision 3 (undo debugobsolete)
378 $ hg rollback
378 $ hg rollback
379 repository tip rolled back to revision 3 (undo debugobsolete)
379 repository tip rolled back to revision 3 (undo debugobsolete)
380 $ hg debugobsolete
380 $ hg debugobsolete
381 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
381 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
382 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
382 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
383 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
383 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
384 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
384 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
385 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 {'date': '1338 0', 'user': 'test'}
385 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 {'date': '1338 0', 'user': 'test'}
386
386
387 $ cd ..
387 $ cd ..
388
388
389 Try to push markers
389 Try to push markers
390
390
391 $ hg init tmpd
391 $ hg init tmpd
392 $ hg -R tmpb push tmpd
392 $ hg -R tmpb push tmpd
393 pushing to tmpd
393 pushing to tmpd
394 searching for changes
394 searching for changes
395 adding changesets
395 adding changesets
396 adding manifests
396 adding manifests
397 adding file changes
397 adding file changes
398 added 4 changesets with 4 changes to 4 files (+1 heads)
398 added 4 changesets with 4 changes to 4 files (+1 heads)
399 $ hg -R tmpd debugobsolete
399 $ hg -R tmpd debugobsolete
400 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
400 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
401 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
401 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
402 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
402 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
403 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
403 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
404 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 {'date': '1338 0', 'user': 'test'}
404 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 {'date': '1338 0', 'user': 'test'}
405
405
406 Check obsolete keys are exchanged only if source has an obsolete store
406 Check obsolete keys are exchanged only if source has an obsolete store
407
407
408 $ hg init empty
408 $ hg init empty
409 $ hg --config extensions.debugkeys=debugkeys.py -R empty push tmpd
409 $ hg --config extensions.debugkeys=debugkeys.py -R empty push tmpd
410 pushing to tmpd
410 pushing to tmpd
411 no changes found
411 no changes found
412 listkeys phases
412 listkeys phases
413 listkeys bookmarks
413 listkeys bookmarks
414 [1]
414 [1]
415
415
416 clone support
416 clone support
417 (markers are copied and extinct changesets are included to allow hardlinks)
417 (markers are copied and extinct changesets are included to allow hardlinks)
418
418
419 $ hg clone tmpb clone-dest
419 $ hg clone tmpb clone-dest
420 updating to branch default
420 updating to branch default
421 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
421 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
422 $ hg -R clone-dest log -G --hidden
422 $ hg -R clone-dest log -G --hidden
423 @ changeset: 6:6f9641995072
423 @ changeset: 6:6f9641995072
424 | tag: tip
424 | tag: tip
425 | parent: 1:7c3bad9141dc
425 | parent: 1:7c3bad9141dc
426 | user: test
426 | user: test
427 | date: Thu Jan 01 00:00:00 1970 +0000
427 | date: Thu Jan 01 00:00:00 1970 +0000
428 | summary: add n3w_3_c
428 | summary: add n3w_3_c
429 |
429 |
430 | x changeset: 5:5601fb93a350
430 | x changeset: 5:5601fb93a350
431 |/ parent: 1:7c3bad9141dc
431 |/ parent: 1:7c3bad9141dc
432 | user: test
432 | user: test
433 | date: Thu Jan 01 00:00:00 1970 +0000
433 | date: Thu Jan 01 00:00:00 1970 +0000
434 | summary: add new_3_c
434 | summary: add new_3_c
435 |
435 |
436 | x changeset: 4:ca819180edb9
436 | x changeset: 4:ca819180edb9
437 |/ parent: 1:7c3bad9141dc
437 |/ parent: 1:7c3bad9141dc
438 | user: test
438 | user: test
439 | date: Thu Jan 01 00:00:00 1970 +0000
439 | date: Thu Jan 01 00:00:00 1970 +0000
440 | summary: add new_2_c
440 | summary: add new_2_c
441 |
441 |
442 | x changeset: 3:cdbce2fbb163
442 | x changeset: 3:cdbce2fbb163
443 |/ parent: 1:7c3bad9141dc
443 |/ parent: 1:7c3bad9141dc
444 | user: test
444 | user: test
445 | date: Thu Jan 01 00:00:00 1970 +0000
445 | date: Thu Jan 01 00:00:00 1970 +0000
446 | summary: add new_c
446 | summary: add new_c
447 |
447 |
448 | o changeset: 2:245bde4270cd
448 | o changeset: 2:245bde4270cd
449 |/ user: test
449 |/ user: test
450 | date: Thu Jan 01 00:00:00 1970 +0000
450 | date: Thu Jan 01 00:00:00 1970 +0000
451 | summary: add original_c
451 | summary: add original_c
452 |
452 |
453 o changeset: 1:7c3bad9141dc
453 o changeset: 1:7c3bad9141dc
454 | user: test
454 | user: test
455 | date: Thu Jan 01 00:00:00 1970 +0000
455 | date: Thu Jan 01 00:00:00 1970 +0000
456 | summary: add b
456 | summary: add b
457 |
457 |
458 o changeset: 0:1f0dee641bb7
458 o changeset: 0:1f0dee641bb7
459 user: test
459 user: test
460 date: Thu Jan 01 00:00:00 1970 +0000
460 date: Thu Jan 01 00:00:00 1970 +0000
461 summary: add a
461 summary: add a
462
462
463 $ hg -R clone-dest debugobsolete
463 $ hg -R clone-dest debugobsolete
464 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
464 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
465 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
465 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
466 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
466 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
467 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
467 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
468 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 {'date': '1338 0', 'user': 'test'}
468 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 {'date': '1338 0', 'user': 'test'}
469
469
470
470
471 Destination repo have existing data
471 Destination repo have existing data
472 ---------------------------------------
472 ---------------------------------------
473
473
474 On pull
474 On pull
475
475
476 $ hg init tmpe
476 $ hg init tmpe
477 $ cd tmpe
477 $ cd tmpe
478 $ hg debugobsolete -d '1339 0' 2448244824482448244824482448244824482448 1339133913391339133913391339133913391339
478 $ hg debugobsolete -d '1339 0' 2448244824482448244824482448244824482448 1339133913391339133913391339133913391339
479 $ hg pull ../tmpb
479 $ hg pull ../tmpb
480 pulling from ../tmpb
480 pulling from ../tmpb
481 requesting all changes
481 requesting all changes
482 adding changesets
482 adding changesets
483 adding manifests
483 adding manifests
484 adding file changes
484 adding file changes
485 added 4 changesets with 4 changes to 4 files (+1 heads)
485 added 4 changesets with 4 changes to 4 files (+1 heads)
486 (run 'hg heads' to see heads, 'hg merge' to merge)
486 (run 'hg heads' to see heads, 'hg merge' to merge)
487 $ hg debugobsolete
487 $ hg debugobsolete
488 2448244824482448244824482448244824482448 1339133913391339133913391339133913391339 0 {'date': '1339 0', 'user': 'test'}
488 2448244824482448244824482448244824482448 1339133913391339133913391339133913391339 0 {'date': '1339 0', 'user': 'test'}
489 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
489 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
490 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
490 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
491 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
491 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
492 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
492 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
493 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 {'date': '1338 0', 'user': 'test'}
493 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 {'date': '1338 0', 'user': 'test'}
494
494
495
495
496 On push
496 On push
497
497
498 $ hg push ../tmpc
498 $ hg push ../tmpc
499 pushing to ../tmpc
499 pushing to ../tmpc
500 searching for changes
500 searching for changes
501 no changes found
501 no changes found
502 [1]
502 [1]
503 $ hg -R ../tmpc debugobsolete
503 $ hg -R ../tmpc debugobsolete
504 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
504 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
505 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
505 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
506 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
506 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
507 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
507 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
508 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 {'date': '1338 0', 'user': 'test'}
508 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 {'date': '1338 0', 'user': 'test'}
509 2448244824482448244824482448244824482448 1339133913391339133913391339133913391339 0 {'date': '1339 0', 'user': 'test'}
509 2448244824482448244824482448244824482448 1339133913391339133913391339133913391339 0 {'date': '1339 0', 'user': 'test'}
510
510
511 detect outgoing obsolete and unstable
511 detect outgoing obsolete and unstable
512 ---------------------------------------
512 ---------------------------------------
513
513
514
514
515 $ hg log -G
515 $ hg log -G
516 o changeset: 3:6f9641995072
516 o changeset: 3:6f9641995072
517 | tag: tip
517 | tag: tip
518 | parent: 1:7c3bad9141dc
518 | parent: 1:7c3bad9141dc
519 | user: test
519 | user: test
520 | date: Thu Jan 01 00:00:00 1970 +0000
520 | date: Thu Jan 01 00:00:00 1970 +0000
521 | summary: add n3w_3_c
521 | summary: add n3w_3_c
522 |
522 |
523 | o changeset: 2:245bde4270cd
523 | o changeset: 2:245bde4270cd
524 |/ user: test
524 |/ user: test
525 | date: Thu Jan 01 00:00:00 1970 +0000
525 | date: Thu Jan 01 00:00:00 1970 +0000
526 | summary: add original_c
526 | summary: add original_c
527 |
527 |
528 o changeset: 1:7c3bad9141dc
528 o changeset: 1:7c3bad9141dc
529 | user: test
529 | user: test
530 | date: Thu Jan 01 00:00:00 1970 +0000
530 | date: Thu Jan 01 00:00:00 1970 +0000
531 | summary: add b
531 | summary: add b
532 |
532 |
533 o changeset: 0:1f0dee641bb7
533 o changeset: 0:1f0dee641bb7
534 user: test
534 user: test
535 date: Thu Jan 01 00:00:00 1970 +0000
535 date: Thu Jan 01 00:00:00 1970 +0000
536 summary: add a
536 summary: add a
537
537
538 $ hg up 'desc("n3w_3_c")'
538 $ hg up 'desc("n3w_3_c")'
539 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
539 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
540 $ mkcommit original_d
540 $ mkcommit original_d
541 $ mkcommit original_e
541 $ mkcommit original_e
542 $ hg debugobsolete `getid original_d` -d '0 0'
542 $ hg debugobsolete `getid original_d` -d '0 0'
543 $ hg log -r 'obsolete()'
543 $ hg log -r 'obsolete()'
544 changeset: 4:94b33453f93b
544 changeset: 4:94b33453f93b
545 user: test
545 user: test
546 date: Thu Jan 01 00:00:00 1970 +0000
546 date: Thu Jan 01 00:00:00 1970 +0000
547 summary: add original_d
547 summary: add original_d
548
548
549 $ hg log -G -r '::unstable()'
549 $ hg log -G -r '::unstable()'
550 @ changeset: 5:cda648ca50f5
550 @ changeset: 5:cda648ca50f5
551 | tag: tip
551 | tag: tip
552 | user: test
552 | user: test
553 | date: Thu Jan 01 00:00:00 1970 +0000
553 | date: Thu Jan 01 00:00:00 1970 +0000
554 | summary: add original_e
554 | summary: add original_e
555 |
555 |
556 x changeset: 4:94b33453f93b
556 x changeset: 4:94b33453f93b
557 | user: test
557 | user: test
558 | date: Thu Jan 01 00:00:00 1970 +0000
558 | date: Thu Jan 01 00:00:00 1970 +0000
559 | summary: add original_d
559 | summary: add original_d
560 |
560 |
561 o changeset: 3:6f9641995072
561 o changeset: 3:6f9641995072
562 | parent: 1:7c3bad9141dc
562 | parent: 1:7c3bad9141dc
563 | user: test
563 | user: test
564 | date: Thu Jan 01 00:00:00 1970 +0000
564 | date: Thu Jan 01 00:00:00 1970 +0000
565 | summary: add n3w_3_c
565 | summary: add n3w_3_c
566 |
566 |
567 o changeset: 1:7c3bad9141dc
567 o changeset: 1:7c3bad9141dc
568 | user: test
568 | user: test
569 | date: Thu Jan 01 00:00:00 1970 +0000
569 | date: Thu Jan 01 00:00:00 1970 +0000
570 | summary: add b
570 | summary: add b
571 |
571 |
572 o changeset: 0:1f0dee641bb7
572 o changeset: 0:1f0dee641bb7
573 user: test
573 user: test
574 date: Thu Jan 01 00:00:00 1970 +0000
574 date: Thu Jan 01 00:00:00 1970 +0000
575 summary: add a
575 summary: add a
576
576
577
577
578 refuse to push obsolete changeset
578 refuse to push obsolete changeset
579
579
580 $ hg push ../tmpc/ -r 'desc("original_d")'
580 $ hg push ../tmpc/ -r 'desc("original_d")'
581 pushing to ../tmpc/
581 pushing to ../tmpc/
582 searching for changes
582 searching for changes
583 abort: push includes obsolete changeset: 94b33453f93b!
583 abort: push includes obsolete changeset: 94b33453f93b!
584 [255]
584 [255]
585
585
586 refuse to push unstable changeset
586 refuse to push unstable changeset
587
587
588 $ hg push ../tmpc/
588 $ hg push ../tmpc/
589 pushing to ../tmpc/
589 pushing to ../tmpc/
590 searching for changes
590 searching for changes
591 abort: push includes unstable changeset: cda648ca50f5!
591 abort: push includes unstable changeset: cda648ca50f5!
592 [255]
592 [255]
593
593
594 Test that extinct changeset are properly detected
594 Test that extinct changeset are properly detected
595
595
596 $ hg log -r 'extinct()'
596 $ hg log -r 'extinct()'
597
597
598 Don't try to push extinct changeset
598 Don't try to push extinct changeset
599
599
600 $ hg init ../tmpf
600 $ hg init ../tmpf
601 $ hg out ../tmpf
601 $ hg out ../tmpf
602 comparing with ../tmpf
602 comparing with ../tmpf
603 searching for changes
603 searching for changes
604 changeset: 0:1f0dee641bb7
604 changeset: 0:1f0dee641bb7
605 user: test
605 user: test
606 date: Thu Jan 01 00:00:00 1970 +0000
606 date: Thu Jan 01 00:00:00 1970 +0000
607 summary: add a
607 summary: add a
608
608
609 changeset: 1:7c3bad9141dc
609 changeset: 1:7c3bad9141dc
610 user: test
610 user: test
611 date: Thu Jan 01 00:00:00 1970 +0000
611 date: Thu Jan 01 00:00:00 1970 +0000
612 summary: add b
612 summary: add b
613
613
614 changeset: 2:245bde4270cd
614 changeset: 2:245bde4270cd
615 user: test
615 user: test
616 date: Thu Jan 01 00:00:00 1970 +0000
616 date: Thu Jan 01 00:00:00 1970 +0000
617 summary: add original_c
617 summary: add original_c
618
618
619 changeset: 3:6f9641995072
619 changeset: 3:6f9641995072
620 parent: 1:7c3bad9141dc
620 parent: 1:7c3bad9141dc
621 user: test
621 user: test
622 date: Thu Jan 01 00:00:00 1970 +0000
622 date: Thu Jan 01 00:00:00 1970 +0000
623 summary: add n3w_3_c
623 summary: add n3w_3_c
624
624
625 changeset: 4:94b33453f93b
625 changeset: 4:94b33453f93b
626 user: test
626 user: test
627 date: Thu Jan 01 00:00:00 1970 +0000
627 date: Thu Jan 01 00:00:00 1970 +0000
628 summary: add original_d
628 summary: add original_d
629
629
630 changeset: 5:cda648ca50f5
630 changeset: 5:cda648ca50f5
631 tag: tip
631 tag: tip
632 user: test
632 user: test
633 date: Thu Jan 01 00:00:00 1970 +0000
633 date: Thu Jan 01 00:00:00 1970 +0000
634 summary: add original_e
634 summary: add original_e
635
635
636 $ hg push ../tmpf -f # -f because be push unstable too
636 $ hg push ../tmpf -f # -f because be push unstable too
637 pushing to ../tmpf
637 pushing to ../tmpf
638 searching for changes
638 searching for changes
639 adding changesets
639 adding changesets
640 adding manifests
640 adding manifests
641 adding file changes
641 adding file changes
642 added 6 changesets with 6 changes to 6 files (+1 heads)
642 added 6 changesets with 6 changes to 6 files (+1 heads)
643
643
644 no warning displayed
644 no warning displayed
645
645
646 $ hg push ../tmpf
646 $ hg push ../tmpf
647 pushing to ../tmpf
647 pushing to ../tmpf
648 searching for changes
648 searching for changes
649 no changes found
649 no changes found
650 [1]
650 [1]
651
651
652 Do not warn about new head when the new head is a successors of a remote one
652 Do not warn about new head when the new head is a successors of a remote one
653
653
654 $ hg log -G
654 $ hg log -G
655 @ changeset: 5:cda648ca50f5
655 @ changeset: 5:cda648ca50f5
656 | tag: tip
656 | tag: tip
657 | user: test
657 | user: test
658 | date: Thu Jan 01 00:00:00 1970 +0000
658 | date: Thu Jan 01 00:00:00 1970 +0000
659 | summary: add original_e
659 | summary: add original_e
660 |
660 |
661 x changeset: 4:94b33453f93b
661 x changeset: 4:94b33453f93b
662 | user: test
662 | user: test
663 | date: Thu Jan 01 00:00:00 1970 +0000
663 | date: Thu Jan 01 00:00:00 1970 +0000
664 | summary: add original_d
664 | summary: add original_d
665 |
665 |
666 o changeset: 3:6f9641995072
666 o changeset: 3:6f9641995072
667 | parent: 1:7c3bad9141dc
667 | parent: 1:7c3bad9141dc
668 | user: test
668 | user: test
669 | date: Thu Jan 01 00:00:00 1970 +0000
669 | date: Thu Jan 01 00:00:00 1970 +0000
670 | summary: add n3w_3_c
670 | summary: add n3w_3_c
671 |
671 |
672 | o changeset: 2:245bde4270cd
672 | o changeset: 2:245bde4270cd
673 |/ user: test
673 |/ user: test
674 | date: Thu Jan 01 00:00:00 1970 +0000
674 | date: Thu Jan 01 00:00:00 1970 +0000
675 | summary: add original_c
675 | summary: add original_c
676 |
676 |
677 o changeset: 1:7c3bad9141dc
677 o changeset: 1:7c3bad9141dc
678 | user: test
678 | user: test
679 | date: Thu Jan 01 00:00:00 1970 +0000
679 | date: Thu Jan 01 00:00:00 1970 +0000
680 | summary: add b
680 | summary: add b
681 |
681 |
682 o changeset: 0:1f0dee641bb7
682 o changeset: 0:1f0dee641bb7
683 user: test
683 user: test
684 date: Thu Jan 01 00:00:00 1970 +0000
684 date: Thu Jan 01 00:00:00 1970 +0000
685 summary: add a
685 summary: add a
686
686
687 $ hg up -q 'desc(n3w_3_c)'
687 $ hg up -q 'desc(n3w_3_c)'
688 $ mkcommit obsolete_e
688 $ mkcommit obsolete_e
689 created new head
689 created new head
690 $ hg debugobsolete `getid 'original_e'` `getid 'obsolete_e'`
690 $ hg debugobsolete `getid 'original_e'` `getid 'obsolete_e'`
691 $ hg outgoing ../tmpf # parasite hg outgoing testin
691 $ hg outgoing ../tmpf # parasite hg outgoing testin
692 comparing with ../tmpf
692 comparing with ../tmpf
693 searching for changes
693 searching for changes
694 changeset: 6:3de5eca88c00
694 changeset: 6:3de5eca88c00
695 tag: tip
695 tag: tip
696 parent: 3:6f9641995072
696 parent: 3:6f9641995072
697 user: test
697 user: test
698 date: Thu Jan 01 00:00:00 1970 +0000
698 date: Thu Jan 01 00:00:00 1970 +0000
699 summary: add obsolete_e
699 summary: add obsolete_e
700
700
701 $ hg push ../tmpf
701 $ hg push ../tmpf
702 pushing to ../tmpf
702 pushing to ../tmpf
703 searching for changes
703 searching for changes
704 adding changesets
704 adding changesets
705 adding manifests
705 adding manifests
706 adding file changes
706 adding file changes
707 added 1 changesets with 1 changes to 1 files (+1 heads)
707 added 1 changesets with 1 changes to 1 files (+1 heads)
708
708
709 #if serve
709 #if serve
710
710
711 check hgweb does not explode
711 check hgweb does not explode
712 ====================================
712 ====================================
713
713
714 $ hg unbundle $TESTDIR/bundles/hgweb+obs.hg
714 $ hg unbundle $TESTDIR/bundles/hgweb+obs.hg
715 adding changesets
715 adding changesets
716 adding manifests
716 adding manifests
717 adding file changes
717 adding file changes
718 added 62 changesets with 63 changes to 9 files (+60 heads)
718 added 62 changesets with 63 changes to 9 files (+60 heads)
719 (run 'hg heads .' to see heads, 'hg merge' to merge)
719 (run 'hg heads .' to see heads, 'hg merge' to merge)
720 $ for node in `hg log -r 'desc(babar_)' --template '{node}\n'`;
720 $ for node in `hg log -r 'desc(babar_)' --template '{node}\n'`;
721 > do
721 > do
722 > hg debugobsolete $node
722 > hg debugobsolete $node
723 > done
723 > done
724 $ hg up tip
724 $ hg up tip
725 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
725 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
726
726
727 $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
727 $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
728 $ cat hg.pid >> $DAEMON_PIDS
728 $ cat hg.pid >> $DAEMON_PIDS
729
729
730 check changelog view
730 check changelog view
731
731
732 $ "$TESTDIR/get-with-headers.py" --headeronly localhost:$HGPORT 'shortlog/'
732 $ "$TESTDIR/get-with-headers.py" --headeronly localhost:$HGPORT 'shortlog/'
733 200 Script output follows
733 200 Script output follows
734
734
735 check graph view
735 check graph view
736
736
737 $ "$TESTDIR/get-with-headers.py" --headeronly localhost:$HGPORT 'graph'
737 $ "$TESTDIR/get-with-headers.py" --headeronly localhost:$HGPORT 'graph'
738 200 Script output follows
738 200 Script output follows
739
739
740 check filelog view
740 check filelog view
741
741
742 $ "$TESTDIR/get-with-headers.py" --headeronly localhost:$HGPORT 'log/'`hg id --debug --id`/'babar'
742 $ "$TESTDIR/get-with-headers.py" --headeronly localhost:$HGPORT 'log/'`hg id --debug --id`/'babar'
743 200 Script output follows
743 200 Script output follows
744
744
745 $ "$TESTDIR/get-with-headers.py" --headeronly localhost:$HGPORT 'rev/68'
745 $ "$TESTDIR/get-with-headers.py" --headeronly localhost:$HGPORT 'rev/68'
746 200 Script output follows
746 200 Script output follows
747 $ "$TESTDIR/get-with-headers.py" --headeronly localhost:$HGPORT 'rev/67'
747 $ "$TESTDIR/get-with-headers.py" --headeronly localhost:$HGPORT 'rev/67'
748 404 Not Found
748 404 Not Found
749 [1]
749 [1]
750
750
751 check that web.view config option:
751 check that web.view config option:
752
752
753 $ "$TESTDIR/killdaemons.py" hg.pid
753 $ "$TESTDIR/killdaemons.py" hg.pid
754 $ cat >> .hg/hgrc << EOF
754 $ cat >> .hg/hgrc << EOF
755 > [web]
755 > [web]
756 > view=all
756 > view=all
757 > EOF
757 > EOF
758 $ wait
758 $ wait
759 $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
759 $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
760 $ "$TESTDIR/get-with-headers.py" --headeronly localhost:$HGPORT 'rev/67'
760 $ "$TESTDIR/get-with-headers.py" --headeronly localhost:$HGPORT 'rev/67'
761 200 Script output follows
761 200 Script output follows
762 $ "$TESTDIR/killdaemons.py" hg.pid
762 $ "$TESTDIR/killdaemons.py" hg.pid
763
763
764 Checking _enable=False warning if obsolete marker exists
764 Checking _enable=False warning if obsolete marker exists
765
765
766 $ echo '[extensions]' >> $HGRCPATH
766 $ echo '[extensions]' >> $HGRCPATH
767 $ echo "obs=!" >> $HGRCPATH
767 $ echo "obs=!" >> $HGRCPATH
768 $ hg log -r tip
768 $ hg log -r tip
769 obsolete feature not enabled but 68 markers found!
769 obsolete feature not enabled but 68 markers found!
770 changeset: 68:c15e9edfca13
770 changeset: 68:c15e9edfca13
771 tag: tip
771 tag: tip
772 parent: 7:50c51b361e60
772 parent: 7:50c51b361e60
773 user: test
773 user: test
774 date: Thu Jan 01 00:00:00 1970 +0000
774 date: Thu Jan 01 00:00:00 1970 +0000
775 summary: add celestine
775 summary: add celestine
776
776
777
777
778 reenable for later test
778 reenable for later test
779
779
780 $ echo '[extensions]' >> $HGRCPATH
780 $ echo '[extensions]' >> $HGRCPATH
781 $ echo "obs=${TESTTMP}/obs.py" >> $HGRCPATH
781 $ echo "obs=${TESTTMP}/obs.py" >> $HGRCPATH
782
782
783 #endif
783 #endif
784
784
785 Test incoming/outcoming with changesets obsoleted remotely, known locally
785 Test incoming/outcoming with changesets obsoleted remotely, known locally
786 ===============================================================================
786 ===============================================================================
787
787
788 This test issue 3805
788 This test issue 3805
789
789
790 $ hg init repo-issue3805
790 $ hg init repo-issue3805
791 $ cd repo-issue3805
791 $ cd repo-issue3805
792 $ echo "foo" > foo
792 $ echo "foo" > foo
793 $ hg ci -Am "A"
793 $ hg ci -Am "A"
794 adding foo
794 adding foo
795 $ hg clone . ../other-issue3805
795 $ hg clone . ../other-issue3805
796 updating to branch default
796 updating to branch default
797 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
797 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
798 $ echo "bar" >> foo
798 $ echo "bar" >> foo
799 $ hg ci --amend
799 $ hg ci --amend
800 $ cd ../other-issue3805
800 $ cd ../other-issue3805
801 $ hg log -G
801 $ hg log -G
802 @ changeset: 0:193e9254ce7e
802 @ changeset: 0:193e9254ce7e
803 tag: tip
803 tag: tip
804 user: test
804 user: test
805 date: Thu Jan 01 00:00:00 1970 +0000
805 date: Thu Jan 01 00:00:00 1970 +0000
806 summary: A
806 summary: A
807
807
808 $ hg log -G -R ../repo-issue3805
808 $ hg log -G -R ../repo-issue3805
809 @ changeset: 2:3816541e5485
809 @ changeset: 2:3816541e5485
810 tag: tip
810 tag: tip
811 parent: -1:000000000000
811 parent: -1:000000000000
812 user: test
812 user: test
813 date: Thu Jan 01 00:00:00 1970 +0000
813 date: Thu Jan 01 00:00:00 1970 +0000
814 summary: A
814 summary: A
815
815
816 $ hg incoming
816 $ hg incoming
817 comparing with $TESTTMP/tmpe/repo-issue3805 (glob)
817 comparing with $TESTTMP/tmpe/repo-issue3805 (glob)
818 searching for changes
818 searching for changes
819 changeset: 2:3816541e5485
819 changeset: 2:3816541e5485
820 tag: tip
820 tag: tip
821 parent: -1:000000000000
821 parent: -1:000000000000
822 user: test
822 user: test
823 date: Thu Jan 01 00:00:00 1970 +0000
823 date: Thu Jan 01 00:00:00 1970 +0000
824 summary: A
824 summary: A
825
825
826 $ hg incoming --bundle ../issue3805.hg
826 $ hg incoming --bundle ../issue3805.hg
827 comparing with $TESTTMP/tmpe/repo-issue3805 (glob)
827 comparing with $TESTTMP/tmpe/repo-issue3805 (glob)
828 searching for changes
828 searching for changes
829 changeset: 2:3816541e5485
829 changeset: 2:3816541e5485
830 tag: tip
830 tag: tip
831 parent: -1:000000000000
831 parent: -1:000000000000
832 user: test
832 user: test
833 date: Thu Jan 01 00:00:00 1970 +0000
833 date: Thu Jan 01 00:00:00 1970 +0000
834 summary: A
834 summary: A
835
835
836 $ hg outgoing
836 $ hg outgoing
837 comparing with $TESTTMP/tmpe/repo-issue3805 (glob)
837 comparing with $TESTTMP/tmpe/repo-issue3805 (glob)
838 searching for changes
838 searching for changes
839 no changes found
839 no changes found
840 [1]
840 [1]
841
841
842 #if serve
842 #if serve
843
843
844 $ hg serve -R ../repo-issue3805 -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
844 $ hg serve -R ../repo-issue3805 -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
845 $ cat hg.pid >> $DAEMON_PIDS
845 $ cat hg.pid >> $DAEMON_PIDS
846
846
847 $ hg incoming http://localhost:$HGPORT
847 $ hg incoming http://localhost:$HGPORT
848 comparing with http://localhost:$HGPORT/
848 comparing with http://localhost:$HGPORT/
849 searching for changes
849 searching for changes
850 changeset: 1:3816541e5485
850 changeset: 1:3816541e5485
851 tag: tip
851 tag: tip
852 parent: -1:000000000000
852 parent: -1:000000000000
853 user: test
853 user: test
854 date: Thu Jan 01 00:00:00 1970 +0000
854 date: Thu Jan 01 00:00:00 1970 +0000
855 summary: A
855 summary: A
856
856
857 $ hg outgoing http://localhost:$HGPORT
857 $ hg outgoing http://localhost:$HGPORT
858 comparing with http://localhost:$HGPORT/
858 comparing with http://localhost:$HGPORT/
859 searching for changes
859 searching for changes
860 no changes found
860 no changes found
861 [1]
861 [1]
862
862
863 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
863 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
864
864
865 #endif
865 #endif
866
866
867 This test issue 3814
867 This test issue 3814
868
868
869 (nothing to push but locally hidden changeset)
869 (nothing to push but locally hidden changeset)
870
870
871 $ cd ..
871 $ cd ..
872 $ hg init repo-issue3814
872 $ hg init repo-issue3814
873 $ cd repo-issue3805
873 $ cd repo-issue3805
874 $ hg push -r 3816541e5485 ../repo-issue3814
874 $ hg push -r 3816541e5485 ../repo-issue3814
875 pushing to ../repo-issue3814
875 pushing to ../repo-issue3814
876 searching for changes
876 searching for changes
877 adding changesets
877 adding changesets
878 adding manifests
878 adding manifests
879 adding file changes
879 adding file changes
880 added 1 changesets with 1 changes to 1 files
880 added 1 changesets with 1 changes to 1 files
881 $ hg out ../repo-issue3814
881 $ hg out ../repo-issue3814
882 comparing with ../repo-issue3814
882 comparing with ../repo-issue3814
883 searching for changes
883 searching for changes
884 no changes found
884 no changes found
885 [1]
885 [1]
886
886
887 Test that a local tag blocks a changeset from being hidden
887
888
889 $ hg tag -l visible -r 0 --hidden
890 $ hg log -G
891 @ changeset: 2:3816541e5485
892 tag: tip
893 parent: -1:000000000000
894 user: test
895 date: Thu Jan 01 00:00:00 1970 +0000
896 summary: A
897
898 x changeset: 0:193e9254ce7e
899 tag: visible
900 user: test
901 date: Thu Jan 01 00:00:00 1970 +0000
902 summary: A
903
General Comments 0
You need to be logged in to leave comments. Login now