##// END OF EJS Templates
branchmap: allow to use cache of subset...
Pierre-Yves David -
r18234:a55b0688 default
parent child Browse files
Show More
@@ -1,215 +1,223 b''
1 # branchmap.py - logic to computes, maintain and stores branchmap for local repo
1 # branchmap.py - logic to computes, maintain and stores branchmap for local repo
2 #
2 #
3 # Copyright 2005-2007 Matt Mackall <mpm@selenic.com>
3 # Copyright 2005-2007 Matt Mackall <mpm@selenic.com>
4 #
4 #
5 # This software may be used and distributed according to the terms of the
5 # This software may be used and distributed according to the terms of the
6 # GNU General Public License version 2 or any later version.
6 # GNU General Public License version 2 or any later version.
7
7
8 from node import bin, hex, nullid, nullrev
8 from node import bin, hex, nullid, nullrev
9 import encoding
9 import encoding
10 import util
10 import util, repoview
11
11
12 def _filename(repo):
12 def _filename(repo):
13 """name of a branchcache file for a given repo or repoview"""
13 """name of a branchcache file for a given repo or repoview"""
14 filename = "cache/branchheads"
14 filename = "cache/branchheads"
15 if repo.filtername:
15 if repo.filtername:
16 filename = '%s-%s' % (filename, repo.filtername)
16 filename = '%s-%s' % (filename, repo.filtername)
17 return filename
17 return filename
18
18
19 def read(repo):
19 def read(repo):
20 try:
20 try:
21 f = repo.opener(_filename(repo))
21 f = repo.opener(_filename(repo))
22 lines = f.read().split('\n')
22 lines = f.read().split('\n')
23 f.close()
23 f.close()
24 except (IOError, OSError):
24 except (IOError, OSError):
25 return None
25 return None
26
26
27 try:
27 try:
28 cachekey = lines.pop(0).split(" ", 2)
28 cachekey = lines.pop(0).split(" ", 2)
29 last, lrev = cachekey[:2]
29 last, lrev = cachekey[:2]
30 last, lrev = bin(last), int(lrev)
30 last, lrev = bin(last), int(lrev)
31 filteredhash = None
31 filteredhash = None
32 if len(cachekey) > 2:
32 if len(cachekey) > 2:
33 filteredhash = bin(cachekey[2])
33 filteredhash = bin(cachekey[2])
34 partial = branchcache(tipnode=last, tiprev=lrev,
34 partial = branchcache(tipnode=last, tiprev=lrev,
35 filteredhash=filteredhash)
35 filteredhash=filteredhash)
36 if not partial.validfor(repo):
36 if not partial.validfor(repo):
37 # invalidate the cache
37 # invalidate the cache
38 raise ValueError('tip differs')
38 raise ValueError('tip differs')
39 for l in lines:
39 for l in lines:
40 if not l:
40 if not l:
41 continue
41 continue
42 node, label = l.split(" ", 1)
42 node, label = l.split(" ", 1)
43 label = encoding.tolocal(label.strip())
43 label = encoding.tolocal(label.strip())
44 if not node in repo:
44 if not node in repo:
45 raise ValueError('node %s does not exist' % node)
45 raise ValueError('node %s does not exist' % node)
46 partial.setdefault(label, []).append(bin(node))
46 partial.setdefault(label, []).append(bin(node))
47 except KeyboardInterrupt:
47 except KeyboardInterrupt:
48 raise
48 raise
49 except Exception, inst:
49 except Exception, inst:
50 if repo.ui.debugflag:
50 if repo.ui.debugflag:
51 msg = 'invalid branchheads cache'
51 msg = 'invalid branchheads cache'
52 if repo.filtername is not None:
52 if repo.filtername is not None:
53 msg += ' (%s)' % repo.filtername
53 msg += ' (%s)' % repo.filtername
54 msg += ': %s\n'
54 msg += ': %s\n'
55 repo.ui.warn(msg % inst)
55 repo.ui.warn(msg % inst)
56 partial = None
56 partial = None
57 return partial
57 return partial
58
58
59
59
60
60
61 def updatecache(repo):
61 def updatecache(repo):
62 cl = repo.changelog
62 cl = repo.changelog
63 filtername = repo.filtername
63 filtername = repo.filtername
64 partial = repo._branchcaches.get(filtername)
64 partial = repo._branchcaches.get(filtername)
65
65
66 revs = []
66 if partial is None or not partial.validfor(repo):
67 if partial is None or not partial.validfor(repo):
67 partial = read(repo)
68 partial = read(repo)
68 if partial is None:
69 if partial is None:
69 partial = branchcache()
70 subsetname = repoview.subsettable.get(filtername)
70
71 if subsetname is None:
71 revs = list(cl.revs(start=partial.tiprev +1))
72 partial = branchcache()
73 else:
74 subset = repo.filtered(subsetname)
75 partial = subset.branchmap().copy()
76 extrarevs = subset.changelog.filteredrevs - cl.filteredrevs
77 revs.extend(r for r in extrarevs if r <= partial.tiprev)
78 revs.extend(cl.revs(start=partial.tiprev + 1))
72 if revs:
79 if revs:
73 ctxgen = (repo[r] for r in revs)
80 ctxgen = (repo[r] for r in revs)
74 partial.update(repo, ctxgen)
81 partial.update(repo, ctxgen)
75 partial.write(repo)
82 partial.write(repo)
83 assert partial.validfor(repo)
76 repo._branchcaches[repo.filtername] = partial
84 repo._branchcaches[repo.filtername] = partial
77
85
78 class branchcache(dict):
86 class branchcache(dict):
79 """A dict like object that hold branches heads cache"""
87 """A dict like object that hold branches heads cache"""
80
88
81 def __init__(self, entries=(), tipnode=nullid, tiprev=nullrev,
89 def __init__(self, entries=(), tipnode=nullid, tiprev=nullrev,
82 filteredhash=None):
90 filteredhash=None):
83 super(branchcache, self).__init__(entries)
91 super(branchcache, self).__init__(entries)
84 self.tipnode = tipnode
92 self.tipnode = tipnode
85 self.tiprev = tiprev
93 self.tiprev = tiprev
86 self.filteredhash = filteredhash
94 self.filteredhash = filteredhash
87
95
88 def _hashfiltered(self, repo):
96 def _hashfiltered(self, repo):
89 """build hash of revision filtered in the current cache
97 """build hash of revision filtered in the current cache
90
98
91 Tracking tipnode and tiprev is not enough to ensure validaty of the
99 Tracking tipnode and tiprev is not enough to ensure validaty of the
92 cache as they do not help to distinct cache that ignored various
100 cache as they do not help to distinct cache that ignored various
93 revision bellow tiprev.
101 revision bellow tiprev.
94
102
95 To detect such difference, we build a cache of all ignored revisions.
103 To detect such difference, we build a cache of all ignored revisions.
96 """
104 """
97 cl = repo.changelog
105 cl = repo.changelog
98 if not cl.filteredrevs:
106 if not cl.filteredrevs:
99 return None
107 return None
100 key = None
108 key = None
101 revs = sorted(r for r in cl.filteredrevs if r <= self.tiprev)
109 revs = sorted(r for r in cl.filteredrevs if r <= self.tiprev)
102 if revs:
110 if revs:
103 s = util.sha1()
111 s = util.sha1()
104 for rev in revs:
112 for rev in revs:
105 s.update('%s;' % rev)
113 s.update('%s;' % rev)
106 key = s.digest()
114 key = s.digest()
107 return key
115 return key
108
116
109 def validfor(self, repo):
117 def validfor(self, repo):
110 """Is the cache content valide regarding a repo
118 """Is the cache content valide regarding a repo
111
119
112 - False when cached tipnode are unknown or if we detect a strip.
120 - False when cached tipnode are unknown or if we detect a strip.
113 - True when cache is up to date or a subset of current repo."""
121 - True when cache is up to date or a subset of current repo."""
114 try:
122 try:
115 return ((self.tipnode == repo.changelog.node(self.tiprev))
123 return ((self.tipnode == repo.changelog.node(self.tiprev))
116 and (self.filteredhash == self._hashfiltered(repo)))
124 and (self.filteredhash == self._hashfiltered(repo)))
117 except IndexError:
125 except IndexError:
118 return False
126 return False
119
127
120 def copy(self):
128 def copy(self):
121 """return an deep copy of the branchcache object"""
129 """return an deep copy of the branchcache object"""
122 return branchcache(self, self.tipnode, self.tiprev, self.filteredhash)
130 return branchcache(self, self.tipnode, self.tiprev, self.filteredhash)
123
131
124 def write(self, repo):
132 def write(self, repo):
125 try:
133 try:
126 f = repo.opener(_filename(repo), "w", atomictemp=True)
134 f = repo.opener(_filename(repo), "w", atomictemp=True)
127 cachekey = [hex(self.tipnode), str(self.tiprev)]
135 cachekey = [hex(self.tipnode), str(self.tiprev)]
128 if self.filteredhash is not None:
136 if self.filteredhash is not None:
129 cachekey.append(hex(self.filteredhash))
137 cachekey.append(hex(self.filteredhash))
130 f.write(" ".join(cachekey) + '\n')
138 f.write(" ".join(cachekey) + '\n')
131 for label, nodes in self.iteritems():
139 for label, nodes in self.iteritems():
132 for node in nodes:
140 for node in nodes:
133 f.write("%s %s\n" % (hex(node), encoding.fromlocal(label)))
141 f.write("%s %s\n" % (hex(node), encoding.fromlocal(label)))
134 f.close()
142 f.close()
135 except (IOError, OSError, util.Abort):
143 except (IOError, OSError, util.Abort):
136 # Abort may be raise by read only opener
144 # Abort may be raise by read only opener
137 pass
145 pass
138
146
139 def update(self, repo, ctxgen):
147 def update(self, repo, ctxgen):
140 """Given a branchhead cache, self, that may have extra nodes or be
148 """Given a branchhead cache, self, that may have extra nodes or be
141 missing heads, and a generator of nodes that are at least a superset of
149 missing heads, and a generator of nodes that are at least a superset of
142 heads missing, this function updates self to be correct.
150 heads missing, this function updates self to be correct.
143 """
151 """
144 cl = repo.changelog
152 cl = repo.changelog
145 # collect new branch entries
153 # collect new branch entries
146 newbranches = {}
154 newbranches = {}
147 for c in ctxgen:
155 for c in ctxgen:
148 newbranches.setdefault(c.branch(), []).append(c.node())
156 newbranches.setdefault(c.branch(), []).append(c.node())
149 # if older branchheads are reachable from new ones, they aren't
157 # if older branchheads are reachable from new ones, they aren't
150 # really branchheads. Note checking parents is insufficient:
158 # really branchheads. Note checking parents is insufficient:
151 # 1 (branch a) -> 2 (branch b) -> 3 (branch a)
159 # 1 (branch a) -> 2 (branch b) -> 3 (branch a)
152 for branch, newnodes in newbranches.iteritems():
160 for branch, newnodes in newbranches.iteritems():
153 bheads = self.setdefault(branch, [])
161 bheads = self.setdefault(branch, [])
154 # Remove candidate heads that no longer are in the repo (e.g., as
162 # Remove candidate heads that no longer are in the repo (e.g., as
155 # the result of a strip that just happened). Avoid using 'node in
163 # the result of a strip that just happened). Avoid using 'node in
156 # self' here because that dives down into branchcache code somewhat
164 # self' here because that dives down into branchcache code somewhat
157 # recursively.
165 # recursively.
158 bheadrevs = [cl.rev(node) for node in bheads
166 bheadrevs = [cl.rev(node) for node in bheads
159 if cl.hasnode(node)]
167 if cl.hasnode(node)]
160 newheadrevs = [cl.rev(node) for node in newnodes
168 newheadrevs = [cl.rev(node) for node in newnodes
161 if cl.hasnode(node)]
169 if cl.hasnode(node)]
162 ctxisnew = bheadrevs and min(newheadrevs) > max(bheadrevs)
170 ctxisnew = bheadrevs and min(newheadrevs) > max(bheadrevs)
163 # Remove duplicates - nodes that are in newheadrevs and are already
171 # Remove duplicates - nodes that are in newheadrevs and are already
164 # in bheadrevs. This can happen if you strip a node whose parent
172 # in bheadrevs. This can happen if you strip a node whose parent
165 # was already a head (because they're on different branches).
173 # was already a head (because they're on different branches).
166 bheadrevs = sorted(set(bheadrevs).union(newheadrevs))
174 bheadrevs = sorted(set(bheadrevs).union(newheadrevs))
167
175
168 # Starting from tip means fewer passes over reachable. If we know
176 # Starting from tip means fewer passes over reachable. If we know
169 # the new candidates are not ancestors of existing heads, we don't
177 # the new candidates are not ancestors of existing heads, we don't
170 # have to examine ancestors of existing heads
178 # have to examine ancestors of existing heads
171 if ctxisnew:
179 if ctxisnew:
172 iterrevs = sorted(newheadrevs)
180 iterrevs = sorted(newheadrevs)
173 else:
181 else:
174 iterrevs = list(bheadrevs)
182 iterrevs = list(bheadrevs)
175
183
176 # This loop prunes out two kinds of heads - heads that are
184 # This loop prunes out two kinds of heads - heads that are
177 # superseded by a head in newheadrevs, and newheadrevs that are not
185 # superseded by a head in newheadrevs, and newheadrevs that are not
178 # heads because an existing head is their descendant.
186 # heads because an existing head is their descendant.
179 while iterrevs:
187 while iterrevs:
180 latest = iterrevs.pop()
188 latest = iterrevs.pop()
181 if latest not in bheadrevs:
189 if latest not in bheadrevs:
182 continue
190 continue
183 ancestors = set(cl.ancestors([latest],
191 ancestors = set(cl.ancestors([latest],
184 bheadrevs[0]))
192 bheadrevs[0]))
185 if ancestors:
193 if ancestors:
186 bheadrevs = [b for b in bheadrevs if b not in ancestors]
194 bheadrevs = [b for b in bheadrevs if b not in ancestors]
187 self[branch] = [cl.node(rev) for rev in bheadrevs]
195 self[branch] = [cl.node(rev) for rev in bheadrevs]
188 tiprev = max(bheadrevs)
196 tiprev = max(bheadrevs)
189 if tiprev > self.tiprev:
197 if tiprev > self.tiprev:
190 self.tipnode = cl.node(tiprev)
198 self.tipnode = cl.node(tiprev)
191 self.tiprev = tiprev
199 self.tiprev = tiprev
192
200
193 # There may be branches that cease to exist when the last commit in the
201 # There may be branches that cease to exist when the last commit in the
194 # branch was stripped. This code filters them out. Note that the
202 # branch was stripped. This code filters them out. Note that the
195 # branch that ceased to exist may not be in newbranches because
203 # branch that ceased to exist may not be in newbranches because
196 # newbranches is the set of candidate heads, which when you strip the
204 # newbranches is the set of candidate heads, which when you strip the
197 # last commit in a branch will be the parent branch.
205 # last commit in a branch will be the parent branch.
198 droppednodes = []
206 droppednodes = []
199 for branch in self.keys():
207 for branch in self.keys():
200 nodes = [head for head in self[branch]
208 nodes = [head for head in self[branch]
201 if cl.hasnode(head)]
209 if cl.hasnode(head)]
202 if not nodes:
210 if not nodes:
203 droppednodes.extend(nodes)
211 droppednodes.extend(nodes)
204 del self[branch]
212 del self[branch]
205 if ((not self.validfor(repo)) or (self.tipnode in droppednodes)):
213 if ((not self.validfor(repo)) or (self.tipnode in droppednodes)):
206
214
207 # cache key are not valid anymore
215 # cache key are not valid anymore
208 self.tipnode = nullid
216 self.tipnode = nullid
209 self.tiprev = nullrev
217 self.tiprev = nullrev
210 for heads in self.values():
218 for heads in self.values():
211 tiprev = max(cl.rev(node) for node in heads)
219 tiprev = max(cl.rev(node) for node in heads)
212 if tiprev > self.tiprev:
220 if tiprev > self.tiprev:
213 self.tipnode = cl.node(tiprev)
221 self.tipnode = cl.node(tiprev)
214 self.tiprev = tiprev
222 self.tiprev = tiprev
215 self.filteredhash = self._hashfiltered(repo)
223 self.filteredhash = self._hashfiltered(repo)
@@ -1,2122 +1,2133 b''
1 > do_push()
1 > do_push()
2 > {
2 > {
3 > user=$1
3 > user=$1
4 > shift
4 > shift
5 > echo "Pushing as user $user"
5 > echo "Pushing as user $user"
6 > echo 'hgrc = """'
6 > echo 'hgrc = """'
7 > sed -e 1,2d b/.hg/hgrc | grep -v fakegroups.py
7 > sed -e 1,2d b/.hg/hgrc | grep -v fakegroups.py
8 > echo '"""'
8 > echo '"""'
9 > if test -f acl.config; then
9 > if test -f acl.config; then
10 > echo 'acl.config = """'
10 > echo 'acl.config = """'
11 > cat acl.config
11 > cat acl.config
12 > echo '"""'
12 > echo '"""'
13 > fi
13 > fi
14 > # On AIX /etc/profile sets LOGNAME read-only. So
14 > # On AIX /etc/profile sets LOGNAME read-only. So
15 > # LOGNAME=$user hg --cws a --debug push ../b
15 > # LOGNAME=$user hg --cws a --debug push ../b
16 > # fails with "This variable is read only."
16 > # fails with "This variable is read only."
17 > # Use env to work around this.
17 > # Use env to work around this.
18 > env LOGNAME=$user hg --cwd a --debug push ../b
18 > env LOGNAME=$user hg --cwd a --debug push ../b
19 > hg --cwd b rollback
19 > hg --cwd b rollback
20 > hg --cwd b --quiet tip
20 > hg --cwd b --quiet tip
21 > echo
21 > echo
22 > }
22 > }
23
23
24 > init_config()
24 > init_config()
25 > {
25 > {
26 > cat > fakegroups.py <<EOF
26 > cat > fakegroups.py <<EOF
27 > from hgext import acl
27 > from hgext import acl
28 > def fakegetusers(ui, group):
28 > def fakegetusers(ui, group):
29 > try:
29 > try:
30 > return acl._getusersorig(ui, group)
30 > return acl._getusersorig(ui, group)
31 > except:
31 > except:
32 > return ["fred", "betty"]
32 > return ["fred", "betty"]
33 > acl._getusersorig = acl._getusers
33 > acl._getusersorig = acl._getusers
34 > acl._getusers = fakegetusers
34 > acl._getusers = fakegetusers
35 > EOF
35 > EOF
36 > rm -f acl.config
36 > rm -f acl.config
37 > cat > $config <<EOF
37 > cat > $config <<EOF
38 > [hooks]
38 > [hooks]
39 > pretxnchangegroup.acl = python:hgext.acl.hook
39 > pretxnchangegroup.acl = python:hgext.acl.hook
40 > [acl]
40 > [acl]
41 > sources = push
41 > sources = push
42 > [extensions]
42 > [extensions]
43 > f=`pwd`/fakegroups.py
43 > f=`pwd`/fakegroups.py
44 > EOF
44 > EOF
45 > }
45 > }
46
46
47 $ hg init a
47 $ hg init a
48 $ cd a
48 $ cd a
49 $ mkdir foo foo/Bar quux
49 $ mkdir foo foo/Bar quux
50 $ echo 'in foo' > foo/file.txt
50 $ echo 'in foo' > foo/file.txt
51 $ echo 'in foo/Bar' > foo/Bar/file.txt
51 $ echo 'in foo/Bar' > foo/Bar/file.txt
52 $ echo 'in quux' > quux/file.py
52 $ echo 'in quux' > quux/file.py
53 $ hg add -q
53 $ hg add -q
54 $ hg ci -m 'add files' -d '1000000 0'
54 $ hg ci -m 'add files' -d '1000000 0'
55 $ echo >> foo/file.txt
55 $ echo >> foo/file.txt
56 $ hg ci -m 'change foo/file' -d '1000001 0'
56 $ hg ci -m 'change foo/file' -d '1000001 0'
57 $ echo >> foo/Bar/file.txt
57 $ echo >> foo/Bar/file.txt
58 $ hg ci -m 'change foo/Bar/file' -d '1000002 0'
58 $ hg ci -m 'change foo/Bar/file' -d '1000002 0'
59 $ echo >> quux/file.py
59 $ echo >> quux/file.py
60 $ hg ci -m 'change quux/file' -d '1000003 0'
60 $ hg ci -m 'change quux/file' -d '1000003 0'
61 $ hg tip --quiet
61 $ hg tip --quiet
62 3:911600dab2ae
62 3:911600dab2ae
63
63
64 $ cd ..
64 $ cd ..
65 $ hg clone -r 0 a b
65 $ hg clone -r 0 a b
66 adding changesets
66 adding changesets
67 adding manifests
67 adding manifests
68 adding file changes
68 adding file changes
69 added 1 changesets with 3 changes to 3 files
69 added 1 changesets with 3 changes to 3 files
70 updating to branch default
70 updating to branch default
71 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
71 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
72
72
73 $ config=b/.hg/hgrc
73 $ config=b/.hg/hgrc
74
74
75 Extension disabled for lack of a hook
75 Extension disabled for lack of a hook
76
76
77 $ do_push fred
77 $ do_push fred
78 Pushing as user fred
78 Pushing as user fred
79 hgrc = """
79 hgrc = """
80 """
80 """
81 pushing to ../b
81 pushing to ../b
82 query 1; heads
82 query 1; heads
83 searching for changes
83 searching for changes
84 all remote heads known locally
84 all remote heads known locally
85 listing keys for "bookmarks"
85 listing keys for "bookmarks"
86 3 changesets found
86 3 changesets found
87 list of changesets:
87 list of changesets:
88 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
88 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
89 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
89 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
90 911600dab2ae7a9baff75958b84fe606851ce955
90 911600dab2ae7a9baff75958b84fe606851ce955
91 adding changesets
91 adding changesets
92 bundling: 1/3 changesets (33.33%)
92 bundling: 1/3 changesets (33.33%)
93 bundling: 2/3 changesets (66.67%)
93 bundling: 2/3 changesets (66.67%)
94 bundling: 3/3 changesets (100.00%)
94 bundling: 3/3 changesets (100.00%)
95 bundling: 1/3 manifests (33.33%)
95 bundling: 1/3 manifests (33.33%)
96 bundling: 2/3 manifests (66.67%)
96 bundling: 2/3 manifests (66.67%)
97 bundling: 3/3 manifests (100.00%)
97 bundling: 3/3 manifests (100.00%)
98 bundling: foo/Bar/file.txt 1/3 files (33.33%)
98 bundling: foo/Bar/file.txt 1/3 files (33.33%)
99 bundling: foo/file.txt 2/3 files (66.67%)
99 bundling: foo/file.txt 2/3 files (66.67%)
100 bundling: quux/file.py 3/3 files (100.00%)
100 bundling: quux/file.py 3/3 files (100.00%)
101 changesets: 1 chunks
101 changesets: 1 chunks
102 add changeset ef1ea85a6374
102 add changeset ef1ea85a6374
103 changesets: 2 chunks
103 changesets: 2 chunks
104 add changeset f9cafe1212c8
104 add changeset f9cafe1212c8
105 changesets: 3 chunks
105 changesets: 3 chunks
106 add changeset 911600dab2ae
106 add changeset 911600dab2ae
107 adding manifests
107 adding manifests
108 manifests: 1/3 chunks (33.33%)
108 manifests: 1/3 chunks (33.33%)
109 manifests: 2/3 chunks (66.67%)
109 manifests: 2/3 chunks (66.67%)
110 manifests: 3/3 chunks (100.00%)
110 manifests: 3/3 chunks (100.00%)
111 adding file changes
111 adding file changes
112 adding foo/Bar/file.txt revisions
112 adding foo/Bar/file.txt revisions
113 files: 1/3 chunks (33.33%)
113 files: 1/3 chunks (33.33%)
114 adding foo/file.txt revisions
114 adding foo/file.txt revisions
115 files: 2/3 chunks (66.67%)
115 files: 2/3 chunks (66.67%)
116 adding quux/file.py revisions
116 adding quux/file.py revisions
117 files: 3/3 chunks (100.00%)
117 files: 3/3 chunks (100.00%)
118 added 3 changesets with 3 changes to 3 files
118 added 3 changesets with 3 changes to 3 files
119 listing keys for "phases"
119 listing keys for "phases"
120 try to push obsolete markers to remote
120 try to push obsolete markers to remote
121 updating the branch cache
121 updating the branch cache
122 checking for updated bookmarks
122 checking for updated bookmarks
123 listing keys for "bookmarks"
123 listing keys for "bookmarks"
124 repository tip rolled back to revision 0 (undo push)
124 repository tip rolled back to revision 0 (undo push)
125 0:6675d58eff77
125 0:6675d58eff77
126
126
127
127
128 $ echo '[hooks]' >> $config
128 $ echo '[hooks]' >> $config
129 $ echo 'pretxnchangegroup.acl = python:hgext.acl.hook' >> $config
129 $ echo 'pretxnchangegroup.acl = python:hgext.acl.hook' >> $config
130
130
131 Extension disabled for lack of acl.sources
131 Extension disabled for lack of acl.sources
132
132
133 $ do_push fred
133 $ do_push fred
134 Pushing as user fred
134 Pushing as user fred
135 hgrc = """
135 hgrc = """
136 [hooks]
136 [hooks]
137 pretxnchangegroup.acl = python:hgext.acl.hook
137 pretxnchangegroup.acl = python:hgext.acl.hook
138 """
138 """
139 pushing to ../b
139 pushing to ../b
140 query 1; heads
140 query 1; heads
141 searching for changes
141 searching for changes
142 all remote heads known locally
142 all remote heads known locally
143 invalid branchheads cache (unserved): tip differs
143 listing keys for "bookmarks"
144 listing keys for "bookmarks"
144 3 changesets found
145 3 changesets found
145 list of changesets:
146 list of changesets:
146 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
147 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
147 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
148 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
148 911600dab2ae7a9baff75958b84fe606851ce955
149 911600dab2ae7a9baff75958b84fe606851ce955
149 adding changesets
150 adding changesets
150 bundling: 1/3 changesets (33.33%)
151 bundling: 1/3 changesets (33.33%)
151 bundling: 2/3 changesets (66.67%)
152 bundling: 2/3 changesets (66.67%)
152 bundling: 3/3 changesets (100.00%)
153 bundling: 3/3 changesets (100.00%)
153 bundling: 1/3 manifests (33.33%)
154 bundling: 1/3 manifests (33.33%)
154 bundling: 2/3 manifests (66.67%)
155 bundling: 2/3 manifests (66.67%)
155 bundling: 3/3 manifests (100.00%)
156 bundling: 3/3 manifests (100.00%)
156 bundling: foo/Bar/file.txt 1/3 files (33.33%)
157 bundling: foo/Bar/file.txt 1/3 files (33.33%)
157 bundling: foo/file.txt 2/3 files (66.67%)
158 bundling: foo/file.txt 2/3 files (66.67%)
158 bundling: quux/file.py 3/3 files (100.00%)
159 bundling: quux/file.py 3/3 files (100.00%)
159 changesets: 1 chunks
160 changesets: 1 chunks
160 add changeset ef1ea85a6374
161 add changeset ef1ea85a6374
161 changesets: 2 chunks
162 changesets: 2 chunks
162 add changeset f9cafe1212c8
163 add changeset f9cafe1212c8
163 changesets: 3 chunks
164 changesets: 3 chunks
164 add changeset 911600dab2ae
165 add changeset 911600dab2ae
165 adding manifests
166 adding manifests
166 manifests: 1/3 chunks (33.33%)
167 manifests: 1/3 chunks (33.33%)
167 manifests: 2/3 chunks (66.67%)
168 manifests: 2/3 chunks (66.67%)
168 manifests: 3/3 chunks (100.00%)
169 manifests: 3/3 chunks (100.00%)
169 adding file changes
170 adding file changes
170 adding foo/Bar/file.txt revisions
171 adding foo/Bar/file.txt revisions
171 files: 1/3 chunks (33.33%)
172 files: 1/3 chunks (33.33%)
172 adding foo/file.txt revisions
173 adding foo/file.txt revisions
173 files: 2/3 chunks (66.67%)
174 files: 2/3 chunks (66.67%)
174 adding quux/file.py revisions
175 adding quux/file.py revisions
175 files: 3/3 chunks (100.00%)
176 files: 3/3 chunks (100.00%)
176 added 3 changesets with 3 changes to 3 files
177 added 3 changesets with 3 changes to 3 files
177 calling hook pretxnchangegroup.acl: hgext.acl.hook
178 calling hook pretxnchangegroup.acl: hgext.acl.hook
178 acl: changes have source "push" - skipping
179 acl: changes have source "push" - skipping
179 listing keys for "phases"
180 listing keys for "phases"
180 try to push obsolete markers to remote
181 try to push obsolete markers to remote
181 updating the branch cache
182 updating the branch cache
182 checking for updated bookmarks
183 checking for updated bookmarks
183 listing keys for "bookmarks"
184 listing keys for "bookmarks"
184 repository tip rolled back to revision 0 (undo push)
185 repository tip rolled back to revision 0 (undo push)
185 0:6675d58eff77
186 0:6675d58eff77
186
187
187
188
188 No [acl.allow]/[acl.deny]
189 No [acl.allow]/[acl.deny]
189
190
190 $ echo '[acl]' >> $config
191 $ echo '[acl]' >> $config
191 $ echo 'sources = push' >> $config
192 $ echo 'sources = push' >> $config
192 $ do_push fred
193 $ do_push fred
193 Pushing as user fred
194 Pushing as user fred
194 hgrc = """
195 hgrc = """
195 [hooks]
196 [hooks]
196 pretxnchangegroup.acl = python:hgext.acl.hook
197 pretxnchangegroup.acl = python:hgext.acl.hook
197 [acl]
198 [acl]
198 sources = push
199 sources = push
199 """
200 """
200 pushing to ../b
201 pushing to ../b
201 query 1; heads
202 query 1; heads
202 searching for changes
203 searching for changes
203 all remote heads known locally
204 all remote heads known locally
205 invalid branchheads cache (unserved): tip differs
204 listing keys for "bookmarks"
206 listing keys for "bookmarks"
205 3 changesets found
207 3 changesets found
206 list of changesets:
208 list of changesets:
207 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
209 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
208 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
210 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
209 911600dab2ae7a9baff75958b84fe606851ce955
211 911600dab2ae7a9baff75958b84fe606851ce955
210 adding changesets
212 adding changesets
211 bundling: 1/3 changesets (33.33%)
213 bundling: 1/3 changesets (33.33%)
212 bundling: 2/3 changesets (66.67%)
214 bundling: 2/3 changesets (66.67%)
213 bundling: 3/3 changesets (100.00%)
215 bundling: 3/3 changesets (100.00%)
214 bundling: 1/3 manifests (33.33%)
216 bundling: 1/3 manifests (33.33%)
215 bundling: 2/3 manifests (66.67%)
217 bundling: 2/3 manifests (66.67%)
216 bundling: 3/3 manifests (100.00%)
218 bundling: 3/3 manifests (100.00%)
217 bundling: foo/Bar/file.txt 1/3 files (33.33%)
219 bundling: foo/Bar/file.txt 1/3 files (33.33%)
218 bundling: foo/file.txt 2/3 files (66.67%)
220 bundling: foo/file.txt 2/3 files (66.67%)
219 bundling: quux/file.py 3/3 files (100.00%)
221 bundling: quux/file.py 3/3 files (100.00%)
220 changesets: 1 chunks
222 changesets: 1 chunks
221 add changeset ef1ea85a6374
223 add changeset ef1ea85a6374
222 changesets: 2 chunks
224 changesets: 2 chunks
223 add changeset f9cafe1212c8
225 add changeset f9cafe1212c8
224 changesets: 3 chunks
226 changesets: 3 chunks
225 add changeset 911600dab2ae
227 add changeset 911600dab2ae
226 adding manifests
228 adding manifests
227 manifests: 1/3 chunks (33.33%)
229 manifests: 1/3 chunks (33.33%)
228 manifests: 2/3 chunks (66.67%)
230 manifests: 2/3 chunks (66.67%)
229 manifests: 3/3 chunks (100.00%)
231 manifests: 3/3 chunks (100.00%)
230 adding file changes
232 adding file changes
231 adding foo/Bar/file.txt revisions
233 adding foo/Bar/file.txt revisions
232 files: 1/3 chunks (33.33%)
234 files: 1/3 chunks (33.33%)
233 adding foo/file.txt revisions
235 adding foo/file.txt revisions
234 files: 2/3 chunks (66.67%)
236 files: 2/3 chunks (66.67%)
235 adding quux/file.py revisions
237 adding quux/file.py revisions
236 files: 3/3 chunks (100.00%)
238 files: 3/3 chunks (100.00%)
237 added 3 changesets with 3 changes to 3 files
239 added 3 changesets with 3 changes to 3 files
238 calling hook pretxnchangegroup.acl: hgext.acl.hook
240 calling hook pretxnchangegroup.acl: hgext.acl.hook
239 acl: checking access for user "fred"
241 acl: checking access for user "fred"
240 acl: acl.allow.branches not enabled
242 acl: acl.allow.branches not enabled
241 acl: acl.deny.branches not enabled
243 acl: acl.deny.branches not enabled
242 acl: acl.allow not enabled
244 acl: acl.allow not enabled
243 acl: acl.deny not enabled
245 acl: acl.deny not enabled
244 acl: branch access granted: "ef1ea85a6374" on branch "default"
246 acl: branch access granted: "ef1ea85a6374" on branch "default"
245 acl: path access granted: "ef1ea85a6374"
247 acl: path access granted: "ef1ea85a6374"
246 acl: branch access granted: "f9cafe1212c8" on branch "default"
248 acl: branch access granted: "f9cafe1212c8" on branch "default"
247 acl: path access granted: "f9cafe1212c8"
249 acl: path access granted: "f9cafe1212c8"
248 acl: branch access granted: "911600dab2ae" on branch "default"
250 acl: branch access granted: "911600dab2ae" on branch "default"
249 acl: path access granted: "911600dab2ae"
251 acl: path access granted: "911600dab2ae"
250 listing keys for "phases"
252 listing keys for "phases"
251 try to push obsolete markers to remote
253 try to push obsolete markers to remote
252 updating the branch cache
254 updating the branch cache
253 checking for updated bookmarks
255 checking for updated bookmarks
254 listing keys for "bookmarks"
256 listing keys for "bookmarks"
255 repository tip rolled back to revision 0 (undo push)
257 repository tip rolled back to revision 0 (undo push)
256 0:6675d58eff77
258 0:6675d58eff77
257
259
258
260
259 Empty [acl.allow]
261 Empty [acl.allow]
260
262
261 $ echo '[acl.allow]' >> $config
263 $ echo '[acl.allow]' >> $config
262 $ do_push fred
264 $ do_push fred
263 Pushing as user fred
265 Pushing as user fred
264 hgrc = """
266 hgrc = """
265 [hooks]
267 [hooks]
266 pretxnchangegroup.acl = python:hgext.acl.hook
268 pretxnchangegroup.acl = python:hgext.acl.hook
267 [acl]
269 [acl]
268 sources = push
270 sources = push
269 [acl.allow]
271 [acl.allow]
270 """
272 """
271 pushing to ../b
273 pushing to ../b
272 query 1; heads
274 query 1; heads
273 searching for changes
275 searching for changes
274 all remote heads known locally
276 all remote heads known locally
277 invalid branchheads cache (unserved): tip differs
275 listing keys for "bookmarks"
278 listing keys for "bookmarks"
276 3 changesets found
279 3 changesets found
277 list of changesets:
280 list of changesets:
278 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
281 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
279 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
282 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
280 911600dab2ae7a9baff75958b84fe606851ce955
283 911600dab2ae7a9baff75958b84fe606851ce955
281 adding changesets
284 adding changesets
282 bundling: 1/3 changesets (33.33%)
285 bundling: 1/3 changesets (33.33%)
283 bundling: 2/3 changesets (66.67%)
286 bundling: 2/3 changesets (66.67%)
284 bundling: 3/3 changesets (100.00%)
287 bundling: 3/3 changesets (100.00%)
285 bundling: 1/3 manifests (33.33%)
288 bundling: 1/3 manifests (33.33%)
286 bundling: 2/3 manifests (66.67%)
289 bundling: 2/3 manifests (66.67%)
287 bundling: 3/3 manifests (100.00%)
290 bundling: 3/3 manifests (100.00%)
288 bundling: foo/Bar/file.txt 1/3 files (33.33%)
291 bundling: foo/Bar/file.txt 1/3 files (33.33%)
289 bundling: foo/file.txt 2/3 files (66.67%)
292 bundling: foo/file.txt 2/3 files (66.67%)
290 bundling: quux/file.py 3/3 files (100.00%)
293 bundling: quux/file.py 3/3 files (100.00%)
291 changesets: 1 chunks
294 changesets: 1 chunks
292 add changeset ef1ea85a6374
295 add changeset ef1ea85a6374
293 changesets: 2 chunks
296 changesets: 2 chunks
294 add changeset f9cafe1212c8
297 add changeset f9cafe1212c8
295 changesets: 3 chunks
298 changesets: 3 chunks
296 add changeset 911600dab2ae
299 add changeset 911600dab2ae
297 adding manifests
300 adding manifests
298 manifests: 1/3 chunks (33.33%)
301 manifests: 1/3 chunks (33.33%)
299 manifests: 2/3 chunks (66.67%)
302 manifests: 2/3 chunks (66.67%)
300 manifests: 3/3 chunks (100.00%)
303 manifests: 3/3 chunks (100.00%)
301 adding file changes
304 adding file changes
302 adding foo/Bar/file.txt revisions
305 adding foo/Bar/file.txt revisions
303 files: 1/3 chunks (33.33%)
306 files: 1/3 chunks (33.33%)
304 adding foo/file.txt revisions
307 adding foo/file.txt revisions
305 files: 2/3 chunks (66.67%)
308 files: 2/3 chunks (66.67%)
306 adding quux/file.py revisions
309 adding quux/file.py revisions
307 files: 3/3 chunks (100.00%)
310 files: 3/3 chunks (100.00%)
308 added 3 changesets with 3 changes to 3 files
311 added 3 changesets with 3 changes to 3 files
309 calling hook pretxnchangegroup.acl: hgext.acl.hook
312 calling hook pretxnchangegroup.acl: hgext.acl.hook
310 acl: checking access for user "fred"
313 acl: checking access for user "fred"
311 acl: acl.allow.branches not enabled
314 acl: acl.allow.branches not enabled
312 acl: acl.deny.branches not enabled
315 acl: acl.deny.branches not enabled
313 acl: acl.allow enabled, 0 entries for user fred
316 acl: acl.allow enabled, 0 entries for user fred
314 acl: acl.deny not enabled
317 acl: acl.deny not enabled
315 acl: branch access granted: "ef1ea85a6374" on branch "default"
318 acl: branch access granted: "ef1ea85a6374" on branch "default"
316 error: pretxnchangegroup.acl hook failed: acl: user "fred" not allowed on "foo/file.txt" (changeset "ef1ea85a6374")
319 error: pretxnchangegroup.acl hook failed: acl: user "fred" not allowed on "foo/file.txt" (changeset "ef1ea85a6374")
317 transaction abort!
320 transaction abort!
318 rollback completed
321 rollback completed
319 abort: acl: user "fred" not allowed on "foo/file.txt" (changeset "ef1ea85a6374")
322 abort: acl: user "fred" not allowed on "foo/file.txt" (changeset "ef1ea85a6374")
320 no rollback information available
323 no rollback information available
321 0:6675d58eff77
324 0:6675d58eff77
322
325
323
326
324 fred is allowed inside foo/
327 fred is allowed inside foo/
325
328
326 $ echo 'foo/** = fred' >> $config
329 $ echo 'foo/** = fred' >> $config
327 $ do_push fred
330 $ do_push fred
328 Pushing as user fred
331 Pushing as user fred
329 hgrc = """
332 hgrc = """
330 [hooks]
333 [hooks]
331 pretxnchangegroup.acl = python:hgext.acl.hook
334 pretxnchangegroup.acl = python:hgext.acl.hook
332 [acl]
335 [acl]
333 sources = push
336 sources = push
334 [acl.allow]
337 [acl.allow]
335 foo/** = fred
338 foo/** = fred
336 """
339 """
337 pushing to ../b
340 pushing to ../b
338 query 1; heads
341 query 1; heads
339 searching for changes
342 searching for changes
340 all remote heads known locally
343 all remote heads known locally
341 listing keys for "bookmarks"
344 listing keys for "bookmarks"
342 3 changesets found
345 3 changesets found
343 list of changesets:
346 list of changesets:
344 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
347 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
345 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
348 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
346 911600dab2ae7a9baff75958b84fe606851ce955
349 911600dab2ae7a9baff75958b84fe606851ce955
347 adding changesets
350 adding changesets
348 bundling: 1/3 changesets (33.33%)
351 bundling: 1/3 changesets (33.33%)
349 bundling: 2/3 changesets (66.67%)
352 bundling: 2/3 changesets (66.67%)
350 bundling: 3/3 changesets (100.00%)
353 bundling: 3/3 changesets (100.00%)
351 bundling: 1/3 manifests (33.33%)
354 bundling: 1/3 manifests (33.33%)
352 bundling: 2/3 manifests (66.67%)
355 bundling: 2/3 manifests (66.67%)
353 bundling: 3/3 manifests (100.00%)
356 bundling: 3/3 manifests (100.00%)
354 bundling: foo/Bar/file.txt 1/3 files (33.33%)
357 bundling: foo/Bar/file.txt 1/3 files (33.33%)
355 bundling: foo/file.txt 2/3 files (66.67%)
358 bundling: foo/file.txt 2/3 files (66.67%)
356 bundling: quux/file.py 3/3 files (100.00%)
359 bundling: quux/file.py 3/3 files (100.00%)
357 changesets: 1 chunks
360 changesets: 1 chunks
358 add changeset ef1ea85a6374
361 add changeset ef1ea85a6374
359 changesets: 2 chunks
362 changesets: 2 chunks
360 add changeset f9cafe1212c8
363 add changeset f9cafe1212c8
361 changesets: 3 chunks
364 changesets: 3 chunks
362 add changeset 911600dab2ae
365 add changeset 911600dab2ae
363 adding manifests
366 adding manifests
364 manifests: 1/3 chunks (33.33%)
367 manifests: 1/3 chunks (33.33%)
365 manifests: 2/3 chunks (66.67%)
368 manifests: 2/3 chunks (66.67%)
366 manifests: 3/3 chunks (100.00%)
369 manifests: 3/3 chunks (100.00%)
367 adding file changes
370 adding file changes
368 adding foo/Bar/file.txt revisions
371 adding foo/Bar/file.txt revisions
369 files: 1/3 chunks (33.33%)
372 files: 1/3 chunks (33.33%)
370 adding foo/file.txt revisions
373 adding foo/file.txt revisions
371 files: 2/3 chunks (66.67%)
374 files: 2/3 chunks (66.67%)
372 adding quux/file.py revisions
375 adding quux/file.py revisions
373 files: 3/3 chunks (100.00%)
376 files: 3/3 chunks (100.00%)
374 added 3 changesets with 3 changes to 3 files
377 added 3 changesets with 3 changes to 3 files
375 calling hook pretxnchangegroup.acl: hgext.acl.hook
378 calling hook pretxnchangegroup.acl: hgext.acl.hook
376 acl: checking access for user "fred"
379 acl: checking access for user "fred"
377 acl: acl.allow.branches not enabled
380 acl: acl.allow.branches not enabled
378 acl: acl.deny.branches not enabled
381 acl: acl.deny.branches not enabled
379 acl: acl.allow enabled, 1 entries for user fred
382 acl: acl.allow enabled, 1 entries for user fred
380 acl: acl.deny not enabled
383 acl: acl.deny not enabled
381 acl: branch access granted: "ef1ea85a6374" on branch "default"
384 acl: branch access granted: "ef1ea85a6374" on branch "default"
382 acl: path access granted: "ef1ea85a6374"
385 acl: path access granted: "ef1ea85a6374"
383 acl: branch access granted: "f9cafe1212c8" on branch "default"
386 acl: branch access granted: "f9cafe1212c8" on branch "default"
384 acl: path access granted: "f9cafe1212c8"
387 acl: path access granted: "f9cafe1212c8"
385 acl: branch access granted: "911600dab2ae" on branch "default"
388 acl: branch access granted: "911600dab2ae" on branch "default"
386 error: pretxnchangegroup.acl hook failed: acl: user "fred" not allowed on "quux/file.py" (changeset "911600dab2ae")
389 error: pretxnchangegroup.acl hook failed: acl: user "fred" not allowed on "quux/file.py" (changeset "911600dab2ae")
387 transaction abort!
390 transaction abort!
388 rollback completed
391 rollback completed
389 abort: acl: user "fred" not allowed on "quux/file.py" (changeset "911600dab2ae")
392 abort: acl: user "fred" not allowed on "quux/file.py" (changeset "911600dab2ae")
390 no rollback information available
393 no rollback information available
391 0:6675d58eff77
394 0:6675d58eff77
392
395
393
396
394 Empty [acl.deny]
397 Empty [acl.deny]
395
398
396 $ echo '[acl.deny]' >> $config
399 $ echo '[acl.deny]' >> $config
397 $ do_push barney
400 $ do_push barney
398 Pushing as user barney
401 Pushing as user barney
399 hgrc = """
402 hgrc = """
400 [hooks]
403 [hooks]
401 pretxnchangegroup.acl = python:hgext.acl.hook
404 pretxnchangegroup.acl = python:hgext.acl.hook
402 [acl]
405 [acl]
403 sources = push
406 sources = push
404 [acl.allow]
407 [acl.allow]
405 foo/** = fred
408 foo/** = fred
406 [acl.deny]
409 [acl.deny]
407 """
410 """
408 pushing to ../b
411 pushing to ../b
409 query 1; heads
412 query 1; heads
410 searching for changes
413 searching for changes
411 all remote heads known locally
414 all remote heads known locally
412 listing keys for "bookmarks"
415 listing keys for "bookmarks"
413 3 changesets found
416 3 changesets found
414 list of changesets:
417 list of changesets:
415 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
418 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
416 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
419 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
417 911600dab2ae7a9baff75958b84fe606851ce955
420 911600dab2ae7a9baff75958b84fe606851ce955
418 adding changesets
421 adding changesets
419 bundling: 1/3 changesets (33.33%)
422 bundling: 1/3 changesets (33.33%)
420 bundling: 2/3 changesets (66.67%)
423 bundling: 2/3 changesets (66.67%)
421 bundling: 3/3 changesets (100.00%)
424 bundling: 3/3 changesets (100.00%)
422 bundling: 1/3 manifests (33.33%)
425 bundling: 1/3 manifests (33.33%)
423 bundling: 2/3 manifests (66.67%)
426 bundling: 2/3 manifests (66.67%)
424 bundling: 3/3 manifests (100.00%)
427 bundling: 3/3 manifests (100.00%)
425 bundling: foo/Bar/file.txt 1/3 files (33.33%)
428 bundling: foo/Bar/file.txt 1/3 files (33.33%)
426 bundling: foo/file.txt 2/3 files (66.67%)
429 bundling: foo/file.txt 2/3 files (66.67%)
427 bundling: quux/file.py 3/3 files (100.00%)
430 bundling: quux/file.py 3/3 files (100.00%)
428 changesets: 1 chunks
431 changesets: 1 chunks
429 add changeset ef1ea85a6374
432 add changeset ef1ea85a6374
430 changesets: 2 chunks
433 changesets: 2 chunks
431 add changeset f9cafe1212c8
434 add changeset f9cafe1212c8
432 changesets: 3 chunks
435 changesets: 3 chunks
433 add changeset 911600dab2ae
436 add changeset 911600dab2ae
434 adding manifests
437 adding manifests
435 manifests: 1/3 chunks (33.33%)
438 manifests: 1/3 chunks (33.33%)
436 manifests: 2/3 chunks (66.67%)
439 manifests: 2/3 chunks (66.67%)
437 manifests: 3/3 chunks (100.00%)
440 manifests: 3/3 chunks (100.00%)
438 adding file changes
441 adding file changes
439 adding foo/Bar/file.txt revisions
442 adding foo/Bar/file.txt revisions
440 files: 1/3 chunks (33.33%)
443 files: 1/3 chunks (33.33%)
441 adding foo/file.txt revisions
444 adding foo/file.txt revisions
442 files: 2/3 chunks (66.67%)
445 files: 2/3 chunks (66.67%)
443 adding quux/file.py revisions
446 adding quux/file.py revisions
444 files: 3/3 chunks (100.00%)
447 files: 3/3 chunks (100.00%)
445 added 3 changesets with 3 changes to 3 files
448 added 3 changesets with 3 changes to 3 files
446 calling hook pretxnchangegroup.acl: hgext.acl.hook
449 calling hook pretxnchangegroup.acl: hgext.acl.hook
447 acl: checking access for user "barney"
450 acl: checking access for user "barney"
448 acl: acl.allow.branches not enabled
451 acl: acl.allow.branches not enabled
449 acl: acl.deny.branches not enabled
452 acl: acl.deny.branches not enabled
450 acl: acl.allow enabled, 0 entries for user barney
453 acl: acl.allow enabled, 0 entries for user barney
451 acl: acl.deny enabled, 0 entries for user barney
454 acl: acl.deny enabled, 0 entries for user barney
452 acl: branch access granted: "ef1ea85a6374" on branch "default"
455 acl: branch access granted: "ef1ea85a6374" on branch "default"
453 error: pretxnchangegroup.acl hook failed: acl: user "barney" not allowed on "foo/file.txt" (changeset "ef1ea85a6374")
456 error: pretxnchangegroup.acl hook failed: acl: user "barney" not allowed on "foo/file.txt" (changeset "ef1ea85a6374")
454 transaction abort!
457 transaction abort!
455 rollback completed
458 rollback completed
456 abort: acl: user "barney" not allowed on "foo/file.txt" (changeset "ef1ea85a6374")
459 abort: acl: user "barney" not allowed on "foo/file.txt" (changeset "ef1ea85a6374")
457 no rollback information available
460 no rollback information available
458 0:6675d58eff77
461 0:6675d58eff77
459
462
460
463
461 fred is allowed inside foo/, but not foo/bar/ (case matters)
464 fred is allowed inside foo/, but not foo/bar/ (case matters)
462
465
463 $ echo 'foo/bar/** = fred' >> $config
466 $ echo 'foo/bar/** = fred' >> $config
464 $ do_push fred
467 $ do_push fred
465 Pushing as user fred
468 Pushing as user fred
466 hgrc = """
469 hgrc = """
467 [hooks]
470 [hooks]
468 pretxnchangegroup.acl = python:hgext.acl.hook
471 pretxnchangegroup.acl = python:hgext.acl.hook
469 [acl]
472 [acl]
470 sources = push
473 sources = push
471 [acl.allow]
474 [acl.allow]
472 foo/** = fred
475 foo/** = fred
473 [acl.deny]
476 [acl.deny]
474 foo/bar/** = fred
477 foo/bar/** = fred
475 """
478 """
476 pushing to ../b
479 pushing to ../b
477 query 1; heads
480 query 1; heads
478 searching for changes
481 searching for changes
479 all remote heads known locally
482 all remote heads known locally
480 listing keys for "bookmarks"
483 listing keys for "bookmarks"
481 3 changesets found
484 3 changesets found
482 list of changesets:
485 list of changesets:
483 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
486 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
484 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
487 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
485 911600dab2ae7a9baff75958b84fe606851ce955
488 911600dab2ae7a9baff75958b84fe606851ce955
486 adding changesets
489 adding changesets
487 bundling: 1/3 changesets (33.33%)
490 bundling: 1/3 changesets (33.33%)
488 bundling: 2/3 changesets (66.67%)
491 bundling: 2/3 changesets (66.67%)
489 bundling: 3/3 changesets (100.00%)
492 bundling: 3/3 changesets (100.00%)
490 bundling: 1/3 manifests (33.33%)
493 bundling: 1/3 manifests (33.33%)
491 bundling: 2/3 manifests (66.67%)
494 bundling: 2/3 manifests (66.67%)
492 bundling: 3/3 manifests (100.00%)
495 bundling: 3/3 manifests (100.00%)
493 bundling: foo/Bar/file.txt 1/3 files (33.33%)
496 bundling: foo/Bar/file.txt 1/3 files (33.33%)
494 bundling: foo/file.txt 2/3 files (66.67%)
497 bundling: foo/file.txt 2/3 files (66.67%)
495 bundling: quux/file.py 3/3 files (100.00%)
498 bundling: quux/file.py 3/3 files (100.00%)
496 changesets: 1 chunks
499 changesets: 1 chunks
497 add changeset ef1ea85a6374
500 add changeset ef1ea85a6374
498 changesets: 2 chunks
501 changesets: 2 chunks
499 add changeset f9cafe1212c8
502 add changeset f9cafe1212c8
500 changesets: 3 chunks
503 changesets: 3 chunks
501 add changeset 911600dab2ae
504 add changeset 911600dab2ae
502 adding manifests
505 adding manifests
503 manifests: 1/3 chunks (33.33%)
506 manifests: 1/3 chunks (33.33%)
504 manifests: 2/3 chunks (66.67%)
507 manifests: 2/3 chunks (66.67%)
505 manifests: 3/3 chunks (100.00%)
508 manifests: 3/3 chunks (100.00%)
506 adding file changes
509 adding file changes
507 adding foo/Bar/file.txt revisions
510 adding foo/Bar/file.txt revisions
508 files: 1/3 chunks (33.33%)
511 files: 1/3 chunks (33.33%)
509 adding foo/file.txt revisions
512 adding foo/file.txt revisions
510 files: 2/3 chunks (66.67%)
513 files: 2/3 chunks (66.67%)
511 adding quux/file.py revisions
514 adding quux/file.py revisions
512 files: 3/3 chunks (100.00%)
515 files: 3/3 chunks (100.00%)
513 added 3 changesets with 3 changes to 3 files
516 added 3 changesets with 3 changes to 3 files
514 calling hook pretxnchangegroup.acl: hgext.acl.hook
517 calling hook pretxnchangegroup.acl: hgext.acl.hook
515 acl: checking access for user "fred"
518 acl: checking access for user "fred"
516 acl: acl.allow.branches not enabled
519 acl: acl.allow.branches not enabled
517 acl: acl.deny.branches not enabled
520 acl: acl.deny.branches not enabled
518 acl: acl.allow enabled, 1 entries for user fred
521 acl: acl.allow enabled, 1 entries for user fred
519 acl: acl.deny enabled, 1 entries for user fred
522 acl: acl.deny enabled, 1 entries for user fred
520 acl: branch access granted: "ef1ea85a6374" on branch "default"
523 acl: branch access granted: "ef1ea85a6374" on branch "default"
521 acl: path access granted: "ef1ea85a6374"
524 acl: path access granted: "ef1ea85a6374"
522 acl: branch access granted: "f9cafe1212c8" on branch "default"
525 acl: branch access granted: "f9cafe1212c8" on branch "default"
523 acl: path access granted: "f9cafe1212c8"
526 acl: path access granted: "f9cafe1212c8"
524 acl: branch access granted: "911600dab2ae" on branch "default"
527 acl: branch access granted: "911600dab2ae" on branch "default"
525 error: pretxnchangegroup.acl hook failed: acl: user "fred" not allowed on "quux/file.py" (changeset "911600dab2ae")
528 error: pretxnchangegroup.acl hook failed: acl: user "fred" not allowed on "quux/file.py" (changeset "911600dab2ae")
526 transaction abort!
529 transaction abort!
527 rollback completed
530 rollback completed
528 abort: acl: user "fred" not allowed on "quux/file.py" (changeset "911600dab2ae")
531 abort: acl: user "fred" not allowed on "quux/file.py" (changeset "911600dab2ae")
529 no rollback information available
532 no rollback information available
530 0:6675d58eff77
533 0:6675d58eff77
531
534
532
535
533 fred is allowed inside foo/, but not foo/Bar/
536 fred is allowed inside foo/, but not foo/Bar/
534
537
535 $ echo 'foo/Bar/** = fred' >> $config
538 $ echo 'foo/Bar/** = fred' >> $config
536 $ do_push fred
539 $ do_push fred
537 Pushing as user fred
540 Pushing as user fred
538 hgrc = """
541 hgrc = """
539 [hooks]
542 [hooks]
540 pretxnchangegroup.acl = python:hgext.acl.hook
543 pretxnchangegroup.acl = python:hgext.acl.hook
541 [acl]
544 [acl]
542 sources = push
545 sources = push
543 [acl.allow]
546 [acl.allow]
544 foo/** = fred
547 foo/** = fred
545 [acl.deny]
548 [acl.deny]
546 foo/bar/** = fred
549 foo/bar/** = fred
547 foo/Bar/** = fred
550 foo/Bar/** = fred
548 """
551 """
549 pushing to ../b
552 pushing to ../b
550 query 1; heads
553 query 1; heads
551 searching for changes
554 searching for changes
552 all remote heads known locally
555 all remote heads known locally
553 listing keys for "bookmarks"
556 listing keys for "bookmarks"
554 3 changesets found
557 3 changesets found
555 list of changesets:
558 list of changesets:
556 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
559 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
557 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
560 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
558 911600dab2ae7a9baff75958b84fe606851ce955
561 911600dab2ae7a9baff75958b84fe606851ce955
559 adding changesets
562 adding changesets
560 bundling: 1/3 changesets (33.33%)
563 bundling: 1/3 changesets (33.33%)
561 bundling: 2/3 changesets (66.67%)
564 bundling: 2/3 changesets (66.67%)
562 bundling: 3/3 changesets (100.00%)
565 bundling: 3/3 changesets (100.00%)
563 bundling: 1/3 manifests (33.33%)
566 bundling: 1/3 manifests (33.33%)
564 bundling: 2/3 manifests (66.67%)
567 bundling: 2/3 manifests (66.67%)
565 bundling: 3/3 manifests (100.00%)
568 bundling: 3/3 manifests (100.00%)
566 bundling: foo/Bar/file.txt 1/3 files (33.33%)
569 bundling: foo/Bar/file.txt 1/3 files (33.33%)
567 bundling: foo/file.txt 2/3 files (66.67%)
570 bundling: foo/file.txt 2/3 files (66.67%)
568 bundling: quux/file.py 3/3 files (100.00%)
571 bundling: quux/file.py 3/3 files (100.00%)
569 changesets: 1 chunks
572 changesets: 1 chunks
570 add changeset ef1ea85a6374
573 add changeset ef1ea85a6374
571 changesets: 2 chunks
574 changesets: 2 chunks
572 add changeset f9cafe1212c8
575 add changeset f9cafe1212c8
573 changesets: 3 chunks
576 changesets: 3 chunks
574 add changeset 911600dab2ae
577 add changeset 911600dab2ae
575 adding manifests
578 adding manifests
576 manifests: 1/3 chunks (33.33%)
579 manifests: 1/3 chunks (33.33%)
577 manifests: 2/3 chunks (66.67%)
580 manifests: 2/3 chunks (66.67%)
578 manifests: 3/3 chunks (100.00%)
581 manifests: 3/3 chunks (100.00%)
579 adding file changes
582 adding file changes
580 adding foo/Bar/file.txt revisions
583 adding foo/Bar/file.txt revisions
581 files: 1/3 chunks (33.33%)
584 files: 1/3 chunks (33.33%)
582 adding foo/file.txt revisions
585 adding foo/file.txt revisions
583 files: 2/3 chunks (66.67%)
586 files: 2/3 chunks (66.67%)
584 adding quux/file.py revisions
587 adding quux/file.py revisions
585 files: 3/3 chunks (100.00%)
588 files: 3/3 chunks (100.00%)
586 added 3 changesets with 3 changes to 3 files
589 added 3 changesets with 3 changes to 3 files
587 calling hook pretxnchangegroup.acl: hgext.acl.hook
590 calling hook pretxnchangegroup.acl: hgext.acl.hook
588 acl: checking access for user "fred"
591 acl: checking access for user "fred"
589 acl: acl.allow.branches not enabled
592 acl: acl.allow.branches not enabled
590 acl: acl.deny.branches not enabled
593 acl: acl.deny.branches not enabled
591 acl: acl.allow enabled, 1 entries for user fred
594 acl: acl.allow enabled, 1 entries for user fred
592 acl: acl.deny enabled, 2 entries for user fred
595 acl: acl.deny enabled, 2 entries for user fred
593 acl: branch access granted: "ef1ea85a6374" on branch "default"
596 acl: branch access granted: "ef1ea85a6374" on branch "default"
594 acl: path access granted: "ef1ea85a6374"
597 acl: path access granted: "ef1ea85a6374"
595 acl: branch access granted: "f9cafe1212c8" on branch "default"
598 acl: branch access granted: "f9cafe1212c8" on branch "default"
596 error: pretxnchangegroup.acl hook failed: acl: user "fred" denied on "foo/Bar/file.txt" (changeset "f9cafe1212c8")
599 error: pretxnchangegroup.acl hook failed: acl: user "fred" denied on "foo/Bar/file.txt" (changeset "f9cafe1212c8")
597 transaction abort!
600 transaction abort!
598 rollback completed
601 rollback completed
599 abort: acl: user "fred" denied on "foo/Bar/file.txt" (changeset "f9cafe1212c8")
602 abort: acl: user "fred" denied on "foo/Bar/file.txt" (changeset "f9cafe1212c8")
600 no rollback information available
603 no rollback information available
601 0:6675d58eff77
604 0:6675d58eff77
602
605
603
606
604 $ echo 'barney is not mentioned => not allowed anywhere'
607 $ echo 'barney is not mentioned => not allowed anywhere'
605 barney is not mentioned => not allowed anywhere
608 barney is not mentioned => not allowed anywhere
606 $ do_push barney
609 $ do_push barney
607 Pushing as user barney
610 Pushing as user barney
608 hgrc = """
611 hgrc = """
609 [hooks]
612 [hooks]
610 pretxnchangegroup.acl = python:hgext.acl.hook
613 pretxnchangegroup.acl = python:hgext.acl.hook
611 [acl]
614 [acl]
612 sources = push
615 sources = push
613 [acl.allow]
616 [acl.allow]
614 foo/** = fred
617 foo/** = fred
615 [acl.deny]
618 [acl.deny]
616 foo/bar/** = fred
619 foo/bar/** = fred
617 foo/Bar/** = fred
620 foo/Bar/** = fred
618 """
621 """
619 pushing to ../b
622 pushing to ../b
620 query 1; heads
623 query 1; heads
621 searching for changes
624 searching for changes
622 all remote heads known locally
625 all remote heads known locally
623 listing keys for "bookmarks"
626 listing keys for "bookmarks"
624 3 changesets found
627 3 changesets found
625 list of changesets:
628 list of changesets:
626 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
629 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
627 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
630 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
628 911600dab2ae7a9baff75958b84fe606851ce955
631 911600dab2ae7a9baff75958b84fe606851ce955
629 adding changesets
632 adding changesets
630 bundling: 1/3 changesets (33.33%)
633 bundling: 1/3 changesets (33.33%)
631 bundling: 2/3 changesets (66.67%)
634 bundling: 2/3 changesets (66.67%)
632 bundling: 3/3 changesets (100.00%)
635 bundling: 3/3 changesets (100.00%)
633 bundling: 1/3 manifests (33.33%)
636 bundling: 1/3 manifests (33.33%)
634 bundling: 2/3 manifests (66.67%)
637 bundling: 2/3 manifests (66.67%)
635 bundling: 3/3 manifests (100.00%)
638 bundling: 3/3 manifests (100.00%)
636 bundling: foo/Bar/file.txt 1/3 files (33.33%)
639 bundling: foo/Bar/file.txt 1/3 files (33.33%)
637 bundling: foo/file.txt 2/3 files (66.67%)
640 bundling: foo/file.txt 2/3 files (66.67%)
638 bundling: quux/file.py 3/3 files (100.00%)
641 bundling: quux/file.py 3/3 files (100.00%)
639 changesets: 1 chunks
642 changesets: 1 chunks
640 add changeset ef1ea85a6374
643 add changeset ef1ea85a6374
641 changesets: 2 chunks
644 changesets: 2 chunks
642 add changeset f9cafe1212c8
645 add changeset f9cafe1212c8
643 changesets: 3 chunks
646 changesets: 3 chunks
644 add changeset 911600dab2ae
647 add changeset 911600dab2ae
645 adding manifests
648 adding manifests
646 manifests: 1/3 chunks (33.33%)
649 manifests: 1/3 chunks (33.33%)
647 manifests: 2/3 chunks (66.67%)
650 manifests: 2/3 chunks (66.67%)
648 manifests: 3/3 chunks (100.00%)
651 manifests: 3/3 chunks (100.00%)
649 adding file changes
652 adding file changes
650 adding foo/Bar/file.txt revisions
653 adding foo/Bar/file.txt revisions
651 files: 1/3 chunks (33.33%)
654 files: 1/3 chunks (33.33%)
652 adding foo/file.txt revisions
655 adding foo/file.txt revisions
653 files: 2/3 chunks (66.67%)
656 files: 2/3 chunks (66.67%)
654 adding quux/file.py revisions
657 adding quux/file.py revisions
655 files: 3/3 chunks (100.00%)
658 files: 3/3 chunks (100.00%)
656 added 3 changesets with 3 changes to 3 files
659 added 3 changesets with 3 changes to 3 files
657 calling hook pretxnchangegroup.acl: hgext.acl.hook
660 calling hook pretxnchangegroup.acl: hgext.acl.hook
658 acl: checking access for user "barney"
661 acl: checking access for user "barney"
659 acl: acl.allow.branches not enabled
662 acl: acl.allow.branches not enabled
660 acl: acl.deny.branches not enabled
663 acl: acl.deny.branches not enabled
661 acl: acl.allow enabled, 0 entries for user barney
664 acl: acl.allow enabled, 0 entries for user barney
662 acl: acl.deny enabled, 0 entries for user barney
665 acl: acl.deny enabled, 0 entries for user barney
663 acl: branch access granted: "ef1ea85a6374" on branch "default"
666 acl: branch access granted: "ef1ea85a6374" on branch "default"
664 error: pretxnchangegroup.acl hook failed: acl: user "barney" not allowed on "foo/file.txt" (changeset "ef1ea85a6374")
667 error: pretxnchangegroup.acl hook failed: acl: user "barney" not allowed on "foo/file.txt" (changeset "ef1ea85a6374")
665 transaction abort!
668 transaction abort!
666 rollback completed
669 rollback completed
667 abort: acl: user "barney" not allowed on "foo/file.txt" (changeset "ef1ea85a6374")
670 abort: acl: user "barney" not allowed on "foo/file.txt" (changeset "ef1ea85a6374")
668 no rollback information available
671 no rollback information available
669 0:6675d58eff77
672 0:6675d58eff77
670
673
671
674
672 barney is allowed everywhere
675 barney is allowed everywhere
673
676
674 $ echo '[acl.allow]' >> $config
677 $ echo '[acl.allow]' >> $config
675 $ echo '** = barney' >> $config
678 $ echo '** = barney' >> $config
676 $ do_push barney
679 $ do_push barney
677 Pushing as user barney
680 Pushing as user barney
678 hgrc = """
681 hgrc = """
679 [hooks]
682 [hooks]
680 pretxnchangegroup.acl = python:hgext.acl.hook
683 pretxnchangegroup.acl = python:hgext.acl.hook
681 [acl]
684 [acl]
682 sources = push
685 sources = push
683 [acl.allow]
686 [acl.allow]
684 foo/** = fred
687 foo/** = fred
685 [acl.deny]
688 [acl.deny]
686 foo/bar/** = fred
689 foo/bar/** = fred
687 foo/Bar/** = fred
690 foo/Bar/** = fred
688 [acl.allow]
691 [acl.allow]
689 ** = barney
692 ** = barney
690 """
693 """
691 pushing to ../b
694 pushing to ../b
692 query 1; heads
695 query 1; heads
693 searching for changes
696 searching for changes
694 all remote heads known locally
697 all remote heads known locally
695 listing keys for "bookmarks"
698 listing keys for "bookmarks"
696 3 changesets found
699 3 changesets found
697 list of changesets:
700 list of changesets:
698 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
701 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
699 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
702 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
700 911600dab2ae7a9baff75958b84fe606851ce955
703 911600dab2ae7a9baff75958b84fe606851ce955
701 adding changesets
704 adding changesets
702 bundling: 1/3 changesets (33.33%)
705 bundling: 1/3 changesets (33.33%)
703 bundling: 2/3 changesets (66.67%)
706 bundling: 2/3 changesets (66.67%)
704 bundling: 3/3 changesets (100.00%)
707 bundling: 3/3 changesets (100.00%)
705 bundling: 1/3 manifests (33.33%)
708 bundling: 1/3 manifests (33.33%)
706 bundling: 2/3 manifests (66.67%)
709 bundling: 2/3 manifests (66.67%)
707 bundling: 3/3 manifests (100.00%)
710 bundling: 3/3 manifests (100.00%)
708 bundling: foo/Bar/file.txt 1/3 files (33.33%)
711 bundling: foo/Bar/file.txt 1/3 files (33.33%)
709 bundling: foo/file.txt 2/3 files (66.67%)
712 bundling: foo/file.txt 2/3 files (66.67%)
710 bundling: quux/file.py 3/3 files (100.00%)
713 bundling: quux/file.py 3/3 files (100.00%)
711 changesets: 1 chunks
714 changesets: 1 chunks
712 add changeset ef1ea85a6374
715 add changeset ef1ea85a6374
713 changesets: 2 chunks
716 changesets: 2 chunks
714 add changeset f9cafe1212c8
717 add changeset f9cafe1212c8
715 changesets: 3 chunks
718 changesets: 3 chunks
716 add changeset 911600dab2ae
719 add changeset 911600dab2ae
717 adding manifests
720 adding manifests
718 manifests: 1/3 chunks (33.33%)
721 manifests: 1/3 chunks (33.33%)
719 manifests: 2/3 chunks (66.67%)
722 manifests: 2/3 chunks (66.67%)
720 manifests: 3/3 chunks (100.00%)
723 manifests: 3/3 chunks (100.00%)
721 adding file changes
724 adding file changes
722 adding foo/Bar/file.txt revisions
725 adding foo/Bar/file.txt revisions
723 files: 1/3 chunks (33.33%)
726 files: 1/3 chunks (33.33%)
724 adding foo/file.txt revisions
727 adding foo/file.txt revisions
725 files: 2/3 chunks (66.67%)
728 files: 2/3 chunks (66.67%)
726 adding quux/file.py revisions
729 adding quux/file.py revisions
727 files: 3/3 chunks (100.00%)
730 files: 3/3 chunks (100.00%)
728 added 3 changesets with 3 changes to 3 files
731 added 3 changesets with 3 changes to 3 files
729 calling hook pretxnchangegroup.acl: hgext.acl.hook
732 calling hook pretxnchangegroup.acl: hgext.acl.hook
730 acl: checking access for user "barney"
733 acl: checking access for user "barney"
731 acl: acl.allow.branches not enabled
734 acl: acl.allow.branches not enabled
732 acl: acl.deny.branches not enabled
735 acl: acl.deny.branches not enabled
733 acl: acl.allow enabled, 1 entries for user barney
736 acl: acl.allow enabled, 1 entries for user barney
734 acl: acl.deny enabled, 0 entries for user barney
737 acl: acl.deny enabled, 0 entries for user barney
735 acl: branch access granted: "ef1ea85a6374" on branch "default"
738 acl: branch access granted: "ef1ea85a6374" on branch "default"
736 acl: path access granted: "ef1ea85a6374"
739 acl: path access granted: "ef1ea85a6374"
737 acl: branch access granted: "f9cafe1212c8" on branch "default"
740 acl: branch access granted: "f9cafe1212c8" on branch "default"
738 acl: path access granted: "f9cafe1212c8"
741 acl: path access granted: "f9cafe1212c8"
739 acl: branch access granted: "911600dab2ae" on branch "default"
742 acl: branch access granted: "911600dab2ae" on branch "default"
740 acl: path access granted: "911600dab2ae"
743 acl: path access granted: "911600dab2ae"
741 listing keys for "phases"
744 listing keys for "phases"
742 try to push obsolete markers to remote
745 try to push obsolete markers to remote
743 updating the branch cache
746 updating the branch cache
744 checking for updated bookmarks
747 checking for updated bookmarks
745 listing keys for "bookmarks"
748 listing keys for "bookmarks"
746 repository tip rolled back to revision 0 (undo push)
749 repository tip rolled back to revision 0 (undo push)
747 0:6675d58eff77
750 0:6675d58eff77
748
751
749
752
750 wilma can change files with a .txt extension
753 wilma can change files with a .txt extension
751
754
752 $ echo '**/*.txt = wilma' >> $config
755 $ echo '**/*.txt = wilma' >> $config
753 $ do_push wilma
756 $ do_push wilma
754 Pushing as user wilma
757 Pushing as user wilma
755 hgrc = """
758 hgrc = """
756 [hooks]
759 [hooks]
757 pretxnchangegroup.acl = python:hgext.acl.hook
760 pretxnchangegroup.acl = python:hgext.acl.hook
758 [acl]
761 [acl]
759 sources = push
762 sources = push
760 [acl.allow]
763 [acl.allow]
761 foo/** = fred
764 foo/** = fred
762 [acl.deny]
765 [acl.deny]
763 foo/bar/** = fred
766 foo/bar/** = fred
764 foo/Bar/** = fred
767 foo/Bar/** = fred
765 [acl.allow]
768 [acl.allow]
766 ** = barney
769 ** = barney
767 **/*.txt = wilma
770 **/*.txt = wilma
768 """
771 """
769 pushing to ../b
772 pushing to ../b
770 query 1; heads
773 query 1; heads
771 searching for changes
774 searching for changes
772 all remote heads known locally
775 all remote heads known locally
776 invalid branchheads cache (unserved): tip differs
773 listing keys for "bookmarks"
777 listing keys for "bookmarks"
774 3 changesets found
778 3 changesets found
775 list of changesets:
779 list of changesets:
776 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
780 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
777 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
781 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
778 911600dab2ae7a9baff75958b84fe606851ce955
782 911600dab2ae7a9baff75958b84fe606851ce955
779 adding changesets
783 adding changesets
780 bundling: 1/3 changesets (33.33%)
784 bundling: 1/3 changesets (33.33%)
781 bundling: 2/3 changesets (66.67%)
785 bundling: 2/3 changesets (66.67%)
782 bundling: 3/3 changesets (100.00%)
786 bundling: 3/3 changesets (100.00%)
783 bundling: 1/3 manifests (33.33%)
787 bundling: 1/3 manifests (33.33%)
784 bundling: 2/3 manifests (66.67%)
788 bundling: 2/3 manifests (66.67%)
785 bundling: 3/3 manifests (100.00%)
789 bundling: 3/3 manifests (100.00%)
786 bundling: foo/Bar/file.txt 1/3 files (33.33%)
790 bundling: foo/Bar/file.txt 1/3 files (33.33%)
787 bundling: foo/file.txt 2/3 files (66.67%)
791 bundling: foo/file.txt 2/3 files (66.67%)
788 bundling: quux/file.py 3/3 files (100.00%)
792 bundling: quux/file.py 3/3 files (100.00%)
789 changesets: 1 chunks
793 changesets: 1 chunks
790 add changeset ef1ea85a6374
794 add changeset ef1ea85a6374
791 changesets: 2 chunks
795 changesets: 2 chunks
792 add changeset f9cafe1212c8
796 add changeset f9cafe1212c8
793 changesets: 3 chunks
797 changesets: 3 chunks
794 add changeset 911600dab2ae
798 add changeset 911600dab2ae
795 adding manifests
799 adding manifests
796 manifests: 1/3 chunks (33.33%)
800 manifests: 1/3 chunks (33.33%)
797 manifests: 2/3 chunks (66.67%)
801 manifests: 2/3 chunks (66.67%)
798 manifests: 3/3 chunks (100.00%)
802 manifests: 3/3 chunks (100.00%)
799 adding file changes
803 adding file changes
800 adding foo/Bar/file.txt revisions
804 adding foo/Bar/file.txt revisions
801 files: 1/3 chunks (33.33%)
805 files: 1/3 chunks (33.33%)
802 adding foo/file.txt revisions
806 adding foo/file.txt revisions
803 files: 2/3 chunks (66.67%)
807 files: 2/3 chunks (66.67%)
804 adding quux/file.py revisions
808 adding quux/file.py revisions
805 files: 3/3 chunks (100.00%)
809 files: 3/3 chunks (100.00%)
806 added 3 changesets with 3 changes to 3 files
810 added 3 changesets with 3 changes to 3 files
807 calling hook pretxnchangegroup.acl: hgext.acl.hook
811 calling hook pretxnchangegroup.acl: hgext.acl.hook
808 acl: checking access for user "wilma"
812 acl: checking access for user "wilma"
809 acl: acl.allow.branches not enabled
813 acl: acl.allow.branches not enabled
810 acl: acl.deny.branches not enabled
814 acl: acl.deny.branches not enabled
811 acl: acl.allow enabled, 1 entries for user wilma
815 acl: acl.allow enabled, 1 entries for user wilma
812 acl: acl.deny enabled, 0 entries for user wilma
816 acl: acl.deny enabled, 0 entries for user wilma
813 acl: branch access granted: "ef1ea85a6374" on branch "default"
817 acl: branch access granted: "ef1ea85a6374" on branch "default"
814 acl: path access granted: "ef1ea85a6374"
818 acl: path access granted: "ef1ea85a6374"
815 acl: branch access granted: "f9cafe1212c8" on branch "default"
819 acl: branch access granted: "f9cafe1212c8" on branch "default"
816 acl: path access granted: "f9cafe1212c8"
820 acl: path access granted: "f9cafe1212c8"
817 acl: branch access granted: "911600dab2ae" on branch "default"
821 acl: branch access granted: "911600dab2ae" on branch "default"
818 error: pretxnchangegroup.acl hook failed: acl: user "wilma" not allowed on "quux/file.py" (changeset "911600dab2ae")
822 error: pretxnchangegroup.acl hook failed: acl: user "wilma" not allowed on "quux/file.py" (changeset "911600dab2ae")
819 transaction abort!
823 transaction abort!
820 rollback completed
824 rollback completed
821 abort: acl: user "wilma" not allowed on "quux/file.py" (changeset "911600dab2ae")
825 abort: acl: user "wilma" not allowed on "quux/file.py" (changeset "911600dab2ae")
822 no rollback information available
826 no rollback information available
823 0:6675d58eff77
827 0:6675d58eff77
824
828
825
829
826 file specified by acl.config does not exist
830 file specified by acl.config does not exist
827
831
828 $ echo '[acl]' >> $config
832 $ echo '[acl]' >> $config
829 $ echo 'config = ../acl.config' >> $config
833 $ echo 'config = ../acl.config' >> $config
830 $ do_push barney
834 $ do_push barney
831 Pushing as user barney
835 Pushing as user barney
832 hgrc = """
836 hgrc = """
833 [hooks]
837 [hooks]
834 pretxnchangegroup.acl = python:hgext.acl.hook
838 pretxnchangegroup.acl = python:hgext.acl.hook
835 [acl]
839 [acl]
836 sources = push
840 sources = push
837 [acl.allow]
841 [acl.allow]
838 foo/** = fred
842 foo/** = fred
839 [acl.deny]
843 [acl.deny]
840 foo/bar/** = fred
844 foo/bar/** = fred
841 foo/Bar/** = fred
845 foo/Bar/** = fred
842 [acl.allow]
846 [acl.allow]
843 ** = barney
847 ** = barney
844 **/*.txt = wilma
848 **/*.txt = wilma
845 [acl]
849 [acl]
846 config = ../acl.config
850 config = ../acl.config
847 """
851 """
848 pushing to ../b
852 pushing to ../b
849 query 1; heads
853 query 1; heads
850 searching for changes
854 searching for changes
851 all remote heads known locally
855 all remote heads known locally
852 listing keys for "bookmarks"
856 listing keys for "bookmarks"
853 3 changesets found
857 3 changesets found
854 list of changesets:
858 list of changesets:
855 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
859 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
856 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
860 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
857 911600dab2ae7a9baff75958b84fe606851ce955
861 911600dab2ae7a9baff75958b84fe606851ce955
858 adding changesets
862 adding changesets
859 bundling: 1/3 changesets (33.33%)
863 bundling: 1/3 changesets (33.33%)
860 bundling: 2/3 changesets (66.67%)
864 bundling: 2/3 changesets (66.67%)
861 bundling: 3/3 changesets (100.00%)
865 bundling: 3/3 changesets (100.00%)
862 bundling: 1/3 manifests (33.33%)
866 bundling: 1/3 manifests (33.33%)
863 bundling: 2/3 manifests (66.67%)
867 bundling: 2/3 manifests (66.67%)
864 bundling: 3/3 manifests (100.00%)
868 bundling: 3/3 manifests (100.00%)
865 bundling: foo/Bar/file.txt 1/3 files (33.33%)
869 bundling: foo/Bar/file.txt 1/3 files (33.33%)
866 bundling: foo/file.txt 2/3 files (66.67%)
870 bundling: foo/file.txt 2/3 files (66.67%)
867 bundling: quux/file.py 3/3 files (100.00%)
871 bundling: quux/file.py 3/3 files (100.00%)
868 changesets: 1 chunks
872 changesets: 1 chunks
869 add changeset ef1ea85a6374
873 add changeset ef1ea85a6374
870 changesets: 2 chunks
874 changesets: 2 chunks
871 add changeset f9cafe1212c8
875 add changeset f9cafe1212c8
872 changesets: 3 chunks
876 changesets: 3 chunks
873 add changeset 911600dab2ae
877 add changeset 911600dab2ae
874 adding manifests
878 adding manifests
875 manifests: 1/3 chunks (33.33%)
879 manifests: 1/3 chunks (33.33%)
876 manifests: 2/3 chunks (66.67%)
880 manifests: 2/3 chunks (66.67%)
877 manifests: 3/3 chunks (100.00%)
881 manifests: 3/3 chunks (100.00%)
878 adding file changes
882 adding file changes
879 adding foo/Bar/file.txt revisions
883 adding foo/Bar/file.txt revisions
880 files: 1/3 chunks (33.33%)
884 files: 1/3 chunks (33.33%)
881 adding foo/file.txt revisions
885 adding foo/file.txt revisions
882 files: 2/3 chunks (66.67%)
886 files: 2/3 chunks (66.67%)
883 adding quux/file.py revisions
887 adding quux/file.py revisions
884 files: 3/3 chunks (100.00%)
888 files: 3/3 chunks (100.00%)
885 added 3 changesets with 3 changes to 3 files
889 added 3 changesets with 3 changes to 3 files
886 calling hook pretxnchangegroup.acl: hgext.acl.hook
890 calling hook pretxnchangegroup.acl: hgext.acl.hook
887 acl: checking access for user "barney"
891 acl: checking access for user "barney"
888 error: pretxnchangegroup.acl hook raised an exception: [Errno *] *: '../acl.config' (glob)
892 error: pretxnchangegroup.acl hook raised an exception: [Errno *] *: '../acl.config' (glob)
889 transaction abort!
893 transaction abort!
890 rollback completed
894 rollback completed
891 abort: *: ../acl.config (glob)
895 abort: *: ../acl.config (glob)
892 no rollback information available
896 no rollback information available
893 0:6675d58eff77
897 0:6675d58eff77
894
898
895
899
896 betty is allowed inside foo/ by a acl.config file
900 betty is allowed inside foo/ by a acl.config file
897
901
898 $ echo '[acl.allow]' >> acl.config
902 $ echo '[acl.allow]' >> acl.config
899 $ echo 'foo/** = betty' >> acl.config
903 $ echo 'foo/** = betty' >> acl.config
900 $ do_push betty
904 $ do_push betty
901 Pushing as user betty
905 Pushing as user betty
902 hgrc = """
906 hgrc = """
903 [hooks]
907 [hooks]
904 pretxnchangegroup.acl = python:hgext.acl.hook
908 pretxnchangegroup.acl = python:hgext.acl.hook
905 [acl]
909 [acl]
906 sources = push
910 sources = push
907 [acl.allow]
911 [acl.allow]
908 foo/** = fred
912 foo/** = fred
909 [acl.deny]
913 [acl.deny]
910 foo/bar/** = fred
914 foo/bar/** = fred
911 foo/Bar/** = fred
915 foo/Bar/** = fred
912 [acl.allow]
916 [acl.allow]
913 ** = barney
917 ** = barney
914 **/*.txt = wilma
918 **/*.txt = wilma
915 [acl]
919 [acl]
916 config = ../acl.config
920 config = ../acl.config
917 """
921 """
918 acl.config = """
922 acl.config = """
919 [acl.allow]
923 [acl.allow]
920 foo/** = betty
924 foo/** = betty
921 """
925 """
922 pushing to ../b
926 pushing to ../b
923 query 1; heads
927 query 1; heads
924 searching for changes
928 searching for changes
925 all remote heads known locally
929 all remote heads known locally
926 listing keys for "bookmarks"
930 listing keys for "bookmarks"
927 3 changesets found
931 3 changesets found
928 list of changesets:
932 list of changesets:
929 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
933 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
930 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
934 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
931 911600dab2ae7a9baff75958b84fe606851ce955
935 911600dab2ae7a9baff75958b84fe606851ce955
932 adding changesets
936 adding changesets
933 bundling: 1/3 changesets (33.33%)
937 bundling: 1/3 changesets (33.33%)
934 bundling: 2/3 changesets (66.67%)
938 bundling: 2/3 changesets (66.67%)
935 bundling: 3/3 changesets (100.00%)
939 bundling: 3/3 changesets (100.00%)
936 bundling: 1/3 manifests (33.33%)
940 bundling: 1/3 manifests (33.33%)
937 bundling: 2/3 manifests (66.67%)
941 bundling: 2/3 manifests (66.67%)
938 bundling: 3/3 manifests (100.00%)
942 bundling: 3/3 manifests (100.00%)
939 bundling: foo/Bar/file.txt 1/3 files (33.33%)
943 bundling: foo/Bar/file.txt 1/3 files (33.33%)
940 bundling: foo/file.txt 2/3 files (66.67%)
944 bundling: foo/file.txt 2/3 files (66.67%)
941 bundling: quux/file.py 3/3 files (100.00%)
945 bundling: quux/file.py 3/3 files (100.00%)
942 changesets: 1 chunks
946 changesets: 1 chunks
943 add changeset ef1ea85a6374
947 add changeset ef1ea85a6374
944 changesets: 2 chunks
948 changesets: 2 chunks
945 add changeset f9cafe1212c8
949 add changeset f9cafe1212c8
946 changesets: 3 chunks
950 changesets: 3 chunks
947 add changeset 911600dab2ae
951 add changeset 911600dab2ae
948 adding manifests
952 adding manifests
949 manifests: 1/3 chunks (33.33%)
953 manifests: 1/3 chunks (33.33%)
950 manifests: 2/3 chunks (66.67%)
954 manifests: 2/3 chunks (66.67%)
951 manifests: 3/3 chunks (100.00%)
955 manifests: 3/3 chunks (100.00%)
952 adding file changes
956 adding file changes
953 adding foo/Bar/file.txt revisions
957 adding foo/Bar/file.txt revisions
954 files: 1/3 chunks (33.33%)
958 files: 1/3 chunks (33.33%)
955 adding foo/file.txt revisions
959 adding foo/file.txt revisions
956 files: 2/3 chunks (66.67%)
960 files: 2/3 chunks (66.67%)
957 adding quux/file.py revisions
961 adding quux/file.py revisions
958 files: 3/3 chunks (100.00%)
962 files: 3/3 chunks (100.00%)
959 added 3 changesets with 3 changes to 3 files
963 added 3 changesets with 3 changes to 3 files
960 calling hook pretxnchangegroup.acl: hgext.acl.hook
964 calling hook pretxnchangegroup.acl: hgext.acl.hook
961 acl: checking access for user "betty"
965 acl: checking access for user "betty"
962 acl: acl.allow.branches not enabled
966 acl: acl.allow.branches not enabled
963 acl: acl.deny.branches not enabled
967 acl: acl.deny.branches not enabled
964 acl: acl.allow enabled, 1 entries for user betty
968 acl: acl.allow enabled, 1 entries for user betty
965 acl: acl.deny enabled, 0 entries for user betty
969 acl: acl.deny enabled, 0 entries for user betty
966 acl: branch access granted: "ef1ea85a6374" on branch "default"
970 acl: branch access granted: "ef1ea85a6374" on branch "default"
967 acl: path access granted: "ef1ea85a6374"
971 acl: path access granted: "ef1ea85a6374"
968 acl: branch access granted: "f9cafe1212c8" on branch "default"
972 acl: branch access granted: "f9cafe1212c8" on branch "default"
969 acl: path access granted: "f9cafe1212c8"
973 acl: path access granted: "f9cafe1212c8"
970 acl: branch access granted: "911600dab2ae" on branch "default"
974 acl: branch access granted: "911600dab2ae" on branch "default"
971 error: pretxnchangegroup.acl hook failed: acl: user "betty" not allowed on "quux/file.py" (changeset "911600dab2ae")
975 error: pretxnchangegroup.acl hook failed: acl: user "betty" not allowed on "quux/file.py" (changeset "911600dab2ae")
972 transaction abort!
976 transaction abort!
973 rollback completed
977 rollback completed
974 abort: acl: user "betty" not allowed on "quux/file.py" (changeset "911600dab2ae")
978 abort: acl: user "betty" not allowed on "quux/file.py" (changeset "911600dab2ae")
975 no rollback information available
979 no rollback information available
976 0:6675d58eff77
980 0:6675d58eff77
977
981
978
982
979 acl.config can set only [acl.allow]/[acl.deny]
983 acl.config can set only [acl.allow]/[acl.deny]
980
984
981 $ echo '[hooks]' >> acl.config
985 $ echo '[hooks]' >> acl.config
982 $ echo 'changegroup.acl = false' >> acl.config
986 $ echo 'changegroup.acl = false' >> acl.config
983 $ do_push barney
987 $ do_push barney
984 Pushing as user barney
988 Pushing as user barney
985 hgrc = """
989 hgrc = """
986 [hooks]
990 [hooks]
987 pretxnchangegroup.acl = python:hgext.acl.hook
991 pretxnchangegroup.acl = python:hgext.acl.hook
988 [acl]
992 [acl]
989 sources = push
993 sources = push
990 [acl.allow]
994 [acl.allow]
991 foo/** = fred
995 foo/** = fred
992 [acl.deny]
996 [acl.deny]
993 foo/bar/** = fred
997 foo/bar/** = fred
994 foo/Bar/** = fred
998 foo/Bar/** = fred
995 [acl.allow]
999 [acl.allow]
996 ** = barney
1000 ** = barney
997 **/*.txt = wilma
1001 **/*.txt = wilma
998 [acl]
1002 [acl]
999 config = ../acl.config
1003 config = ../acl.config
1000 """
1004 """
1001 acl.config = """
1005 acl.config = """
1002 [acl.allow]
1006 [acl.allow]
1003 foo/** = betty
1007 foo/** = betty
1004 [hooks]
1008 [hooks]
1005 changegroup.acl = false
1009 changegroup.acl = false
1006 """
1010 """
1007 pushing to ../b
1011 pushing to ../b
1008 query 1; heads
1012 query 1; heads
1009 searching for changes
1013 searching for changes
1010 all remote heads known locally
1014 all remote heads known locally
1011 listing keys for "bookmarks"
1015 listing keys for "bookmarks"
1012 3 changesets found
1016 3 changesets found
1013 list of changesets:
1017 list of changesets:
1014 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1018 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1015 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1019 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1016 911600dab2ae7a9baff75958b84fe606851ce955
1020 911600dab2ae7a9baff75958b84fe606851ce955
1017 adding changesets
1021 adding changesets
1018 bundling: 1/3 changesets (33.33%)
1022 bundling: 1/3 changesets (33.33%)
1019 bundling: 2/3 changesets (66.67%)
1023 bundling: 2/3 changesets (66.67%)
1020 bundling: 3/3 changesets (100.00%)
1024 bundling: 3/3 changesets (100.00%)
1021 bundling: 1/3 manifests (33.33%)
1025 bundling: 1/3 manifests (33.33%)
1022 bundling: 2/3 manifests (66.67%)
1026 bundling: 2/3 manifests (66.67%)
1023 bundling: 3/3 manifests (100.00%)
1027 bundling: 3/3 manifests (100.00%)
1024 bundling: foo/Bar/file.txt 1/3 files (33.33%)
1028 bundling: foo/Bar/file.txt 1/3 files (33.33%)
1025 bundling: foo/file.txt 2/3 files (66.67%)
1029 bundling: foo/file.txt 2/3 files (66.67%)
1026 bundling: quux/file.py 3/3 files (100.00%)
1030 bundling: quux/file.py 3/3 files (100.00%)
1027 changesets: 1 chunks
1031 changesets: 1 chunks
1028 add changeset ef1ea85a6374
1032 add changeset ef1ea85a6374
1029 changesets: 2 chunks
1033 changesets: 2 chunks
1030 add changeset f9cafe1212c8
1034 add changeset f9cafe1212c8
1031 changesets: 3 chunks
1035 changesets: 3 chunks
1032 add changeset 911600dab2ae
1036 add changeset 911600dab2ae
1033 adding manifests
1037 adding manifests
1034 manifests: 1/3 chunks (33.33%)
1038 manifests: 1/3 chunks (33.33%)
1035 manifests: 2/3 chunks (66.67%)
1039 manifests: 2/3 chunks (66.67%)
1036 manifests: 3/3 chunks (100.00%)
1040 manifests: 3/3 chunks (100.00%)
1037 adding file changes
1041 adding file changes
1038 adding foo/Bar/file.txt revisions
1042 adding foo/Bar/file.txt revisions
1039 files: 1/3 chunks (33.33%)
1043 files: 1/3 chunks (33.33%)
1040 adding foo/file.txt revisions
1044 adding foo/file.txt revisions
1041 files: 2/3 chunks (66.67%)
1045 files: 2/3 chunks (66.67%)
1042 adding quux/file.py revisions
1046 adding quux/file.py revisions
1043 files: 3/3 chunks (100.00%)
1047 files: 3/3 chunks (100.00%)
1044 added 3 changesets with 3 changes to 3 files
1048 added 3 changesets with 3 changes to 3 files
1045 calling hook pretxnchangegroup.acl: hgext.acl.hook
1049 calling hook pretxnchangegroup.acl: hgext.acl.hook
1046 acl: checking access for user "barney"
1050 acl: checking access for user "barney"
1047 acl: acl.allow.branches not enabled
1051 acl: acl.allow.branches not enabled
1048 acl: acl.deny.branches not enabled
1052 acl: acl.deny.branches not enabled
1049 acl: acl.allow enabled, 1 entries for user barney
1053 acl: acl.allow enabled, 1 entries for user barney
1050 acl: acl.deny enabled, 0 entries for user barney
1054 acl: acl.deny enabled, 0 entries for user barney
1051 acl: branch access granted: "ef1ea85a6374" on branch "default"
1055 acl: branch access granted: "ef1ea85a6374" on branch "default"
1052 acl: path access granted: "ef1ea85a6374"
1056 acl: path access granted: "ef1ea85a6374"
1053 acl: branch access granted: "f9cafe1212c8" on branch "default"
1057 acl: branch access granted: "f9cafe1212c8" on branch "default"
1054 acl: path access granted: "f9cafe1212c8"
1058 acl: path access granted: "f9cafe1212c8"
1055 acl: branch access granted: "911600dab2ae" on branch "default"
1059 acl: branch access granted: "911600dab2ae" on branch "default"
1056 acl: path access granted: "911600dab2ae"
1060 acl: path access granted: "911600dab2ae"
1057 listing keys for "phases"
1061 listing keys for "phases"
1058 try to push obsolete markers to remote
1062 try to push obsolete markers to remote
1059 updating the branch cache
1063 updating the branch cache
1060 checking for updated bookmarks
1064 checking for updated bookmarks
1061 listing keys for "bookmarks"
1065 listing keys for "bookmarks"
1062 repository tip rolled back to revision 0 (undo push)
1066 repository tip rolled back to revision 0 (undo push)
1063 0:6675d58eff77
1067 0:6675d58eff77
1064
1068
1065
1069
1066 asterisk
1070 asterisk
1067
1071
1068 $ init_config
1072 $ init_config
1069
1073
1070 asterisk test
1074 asterisk test
1071
1075
1072 $ echo '[acl.allow]' >> $config
1076 $ echo '[acl.allow]' >> $config
1073 $ echo "** = fred" >> $config
1077 $ echo "** = fred" >> $config
1074
1078
1075 fred is always allowed
1079 fred is always allowed
1076
1080
1077 $ do_push fred
1081 $ do_push fred
1078 Pushing as user fred
1082 Pushing as user fred
1079 hgrc = """
1083 hgrc = """
1080 [acl]
1084 [acl]
1081 sources = push
1085 sources = push
1082 [extensions]
1086 [extensions]
1083 [acl.allow]
1087 [acl.allow]
1084 ** = fred
1088 ** = fred
1085 """
1089 """
1086 pushing to ../b
1090 pushing to ../b
1087 query 1; heads
1091 query 1; heads
1088 searching for changes
1092 searching for changes
1089 all remote heads known locally
1093 all remote heads known locally
1094 invalid branchheads cache (unserved): tip differs
1090 listing keys for "bookmarks"
1095 listing keys for "bookmarks"
1091 3 changesets found
1096 3 changesets found
1092 list of changesets:
1097 list of changesets:
1093 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1098 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1094 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1099 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1095 911600dab2ae7a9baff75958b84fe606851ce955
1100 911600dab2ae7a9baff75958b84fe606851ce955
1096 adding changesets
1101 adding changesets
1097 bundling: 1/3 changesets (33.33%)
1102 bundling: 1/3 changesets (33.33%)
1098 bundling: 2/3 changesets (66.67%)
1103 bundling: 2/3 changesets (66.67%)
1099 bundling: 3/3 changesets (100.00%)
1104 bundling: 3/3 changesets (100.00%)
1100 bundling: 1/3 manifests (33.33%)
1105 bundling: 1/3 manifests (33.33%)
1101 bundling: 2/3 manifests (66.67%)
1106 bundling: 2/3 manifests (66.67%)
1102 bundling: 3/3 manifests (100.00%)
1107 bundling: 3/3 manifests (100.00%)
1103 bundling: foo/Bar/file.txt 1/3 files (33.33%)
1108 bundling: foo/Bar/file.txt 1/3 files (33.33%)
1104 bundling: foo/file.txt 2/3 files (66.67%)
1109 bundling: foo/file.txt 2/3 files (66.67%)
1105 bundling: quux/file.py 3/3 files (100.00%)
1110 bundling: quux/file.py 3/3 files (100.00%)
1106 changesets: 1 chunks
1111 changesets: 1 chunks
1107 add changeset ef1ea85a6374
1112 add changeset ef1ea85a6374
1108 changesets: 2 chunks
1113 changesets: 2 chunks
1109 add changeset f9cafe1212c8
1114 add changeset f9cafe1212c8
1110 changesets: 3 chunks
1115 changesets: 3 chunks
1111 add changeset 911600dab2ae
1116 add changeset 911600dab2ae
1112 adding manifests
1117 adding manifests
1113 manifests: 1/3 chunks (33.33%)
1118 manifests: 1/3 chunks (33.33%)
1114 manifests: 2/3 chunks (66.67%)
1119 manifests: 2/3 chunks (66.67%)
1115 manifests: 3/3 chunks (100.00%)
1120 manifests: 3/3 chunks (100.00%)
1116 adding file changes
1121 adding file changes
1117 adding foo/Bar/file.txt revisions
1122 adding foo/Bar/file.txt revisions
1118 files: 1/3 chunks (33.33%)
1123 files: 1/3 chunks (33.33%)
1119 adding foo/file.txt revisions
1124 adding foo/file.txt revisions
1120 files: 2/3 chunks (66.67%)
1125 files: 2/3 chunks (66.67%)
1121 adding quux/file.py revisions
1126 adding quux/file.py revisions
1122 files: 3/3 chunks (100.00%)
1127 files: 3/3 chunks (100.00%)
1123 added 3 changesets with 3 changes to 3 files
1128 added 3 changesets with 3 changes to 3 files
1124 calling hook pretxnchangegroup.acl: hgext.acl.hook
1129 calling hook pretxnchangegroup.acl: hgext.acl.hook
1125 acl: checking access for user "fred"
1130 acl: checking access for user "fred"
1126 acl: acl.allow.branches not enabled
1131 acl: acl.allow.branches not enabled
1127 acl: acl.deny.branches not enabled
1132 acl: acl.deny.branches not enabled
1128 acl: acl.allow enabled, 1 entries for user fred
1133 acl: acl.allow enabled, 1 entries for user fred
1129 acl: acl.deny not enabled
1134 acl: acl.deny not enabled
1130 acl: branch access granted: "ef1ea85a6374" on branch "default"
1135 acl: branch access granted: "ef1ea85a6374" on branch "default"
1131 acl: path access granted: "ef1ea85a6374"
1136 acl: path access granted: "ef1ea85a6374"
1132 acl: branch access granted: "f9cafe1212c8" on branch "default"
1137 acl: branch access granted: "f9cafe1212c8" on branch "default"
1133 acl: path access granted: "f9cafe1212c8"
1138 acl: path access granted: "f9cafe1212c8"
1134 acl: branch access granted: "911600dab2ae" on branch "default"
1139 acl: branch access granted: "911600dab2ae" on branch "default"
1135 acl: path access granted: "911600dab2ae"
1140 acl: path access granted: "911600dab2ae"
1136 listing keys for "phases"
1141 listing keys for "phases"
1137 try to push obsolete markers to remote
1142 try to push obsolete markers to remote
1138 updating the branch cache
1143 updating the branch cache
1139 checking for updated bookmarks
1144 checking for updated bookmarks
1140 listing keys for "bookmarks"
1145 listing keys for "bookmarks"
1141 repository tip rolled back to revision 0 (undo push)
1146 repository tip rolled back to revision 0 (undo push)
1142 0:6675d58eff77
1147 0:6675d58eff77
1143
1148
1144
1149
1145 $ echo '[acl.deny]' >> $config
1150 $ echo '[acl.deny]' >> $config
1146 $ echo "foo/Bar/** = *" >> $config
1151 $ echo "foo/Bar/** = *" >> $config
1147
1152
1148 no one is allowed inside foo/Bar/
1153 no one is allowed inside foo/Bar/
1149
1154
1150 $ do_push fred
1155 $ do_push fred
1151 Pushing as user fred
1156 Pushing as user fred
1152 hgrc = """
1157 hgrc = """
1153 [acl]
1158 [acl]
1154 sources = push
1159 sources = push
1155 [extensions]
1160 [extensions]
1156 [acl.allow]
1161 [acl.allow]
1157 ** = fred
1162 ** = fred
1158 [acl.deny]
1163 [acl.deny]
1159 foo/Bar/** = *
1164 foo/Bar/** = *
1160 """
1165 """
1161 pushing to ../b
1166 pushing to ../b
1162 query 1; heads
1167 query 1; heads
1163 searching for changes
1168 searching for changes
1164 all remote heads known locally
1169 all remote heads known locally
1170 invalid branchheads cache (unserved): tip differs
1165 listing keys for "bookmarks"
1171 listing keys for "bookmarks"
1166 3 changesets found
1172 3 changesets found
1167 list of changesets:
1173 list of changesets:
1168 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1174 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1169 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1175 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1170 911600dab2ae7a9baff75958b84fe606851ce955
1176 911600dab2ae7a9baff75958b84fe606851ce955
1171 adding changesets
1177 adding changesets
1172 bundling: 1/3 changesets (33.33%)
1178 bundling: 1/3 changesets (33.33%)
1173 bundling: 2/3 changesets (66.67%)
1179 bundling: 2/3 changesets (66.67%)
1174 bundling: 3/3 changesets (100.00%)
1180 bundling: 3/3 changesets (100.00%)
1175 bundling: 1/3 manifests (33.33%)
1181 bundling: 1/3 manifests (33.33%)
1176 bundling: 2/3 manifests (66.67%)
1182 bundling: 2/3 manifests (66.67%)
1177 bundling: 3/3 manifests (100.00%)
1183 bundling: 3/3 manifests (100.00%)
1178 bundling: foo/Bar/file.txt 1/3 files (33.33%)
1184 bundling: foo/Bar/file.txt 1/3 files (33.33%)
1179 bundling: foo/file.txt 2/3 files (66.67%)
1185 bundling: foo/file.txt 2/3 files (66.67%)
1180 bundling: quux/file.py 3/3 files (100.00%)
1186 bundling: quux/file.py 3/3 files (100.00%)
1181 changesets: 1 chunks
1187 changesets: 1 chunks
1182 add changeset ef1ea85a6374
1188 add changeset ef1ea85a6374
1183 changesets: 2 chunks
1189 changesets: 2 chunks
1184 add changeset f9cafe1212c8
1190 add changeset f9cafe1212c8
1185 changesets: 3 chunks
1191 changesets: 3 chunks
1186 add changeset 911600dab2ae
1192 add changeset 911600dab2ae
1187 adding manifests
1193 adding manifests
1188 manifests: 1/3 chunks (33.33%)
1194 manifests: 1/3 chunks (33.33%)
1189 manifests: 2/3 chunks (66.67%)
1195 manifests: 2/3 chunks (66.67%)
1190 manifests: 3/3 chunks (100.00%)
1196 manifests: 3/3 chunks (100.00%)
1191 adding file changes
1197 adding file changes
1192 adding foo/Bar/file.txt revisions
1198 adding foo/Bar/file.txt revisions
1193 files: 1/3 chunks (33.33%)
1199 files: 1/3 chunks (33.33%)
1194 adding foo/file.txt revisions
1200 adding foo/file.txt revisions
1195 files: 2/3 chunks (66.67%)
1201 files: 2/3 chunks (66.67%)
1196 adding quux/file.py revisions
1202 adding quux/file.py revisions
1197 files: 3/3 chunks (100.00%)
1203 files: 3/3 chunks (100.00%)
1198 added 3 changesets with 3 changes to 3 files
1204 added 3 changesets with 3 changes to 3 files
1199 calling hook pretxnchangegroup.acl: hgext.acl.hook
1205 calling hook pretxnchangegroup.acl: hgext.acl.hook
1200 acl: checking access for user "fred"
1206 acl: checking access for user "fred"
1201 acl: acl.allow.branches not enabled
1207 acl: acl.allow.branches not enabled
1202 acl: acl.deny.branches not enabled
1208 acl: acl.deny.branches not enabled
1203 acl: acl.allow enabled, 1 entries for user fred
1209 acl: acl.allow enabled, 1 entries for user fred
1204 acl: acl.deny enabled, 1 entries for user fred
1210 acl: acl.deny enabled, 1 entries for user fred
1205 acl: branch access granted: "ef1ea85a6374" on branch "default"
1211 acl: branch access granted: "ef1ea85a6374" on branch "default"
1206 acl: path access granted: "ef1ea85a6374"
1212 acl: path access granted: "ef1ea85a6374"
1207 acl: branch access granted: "f9cafe1212c8" on branch "default"
1213 acl: branch access granted: "f9cafe1212c8" on branch "default"
1208 error: pretxnchangegroup.acl hook failed: acl: user "fred" denied on "foo/Bar/file.txt" (changeset "f9cafe1212c8")
1214 error: pretxnchangegroup.acl hook failed: acl: user "fred" denied on "foo/Bar/file.txt" (changeset "f9cafe1212c8")
1209 transaction abort!
1215 transaction abort!
1210 rollback completed
1216 rollback completed
1211 abort: acl: user "fred" denied on "foo/Bar/file.txt" (changeset "f9cafe1212c8")
1217 abort: acl: user "fred" denied on "foo/Bar/file.txt" (changeset "f9cafe1212c8")
1212 no rollback information available
1218 no rollback information available
1213 0:6675d58eff77
1219 0:6675d58eff77
1214
1220
1215
1221
1216 Groups
1222 Groups
1217
1223
1218 $ init_config
1224 $ init_config
1219
1225
1220 OS-level groups
1226 OS-level groups
1221
1227
1222 $ echo '[acl.allow]' >> $config
1228 $ echo '[acl.allow]' >> $config
1223 $ echo "** = @group1" >> $config
1229 $ echo "** = @group1" >> $config
1224
1230
1225 @group1 is always allowed
1231 @group1 is always allowed
1226
1232
1227 $ do_push fred
1233 $ do_push fred
1228 Pushing as user fred
1234 Pushing as user fred
1229 hgrc = """
1235 hgrc = """
1230 [acl]
1236 [acl]
1231 sources = push
1237 sources = push
1232 [extensions]
1238 [extensions]
1233 [acl.allow]
1239 [acl.allow]
1234 ** = @group1
1240 ** = @group1
1235 """
1241 """
1236 pushing to ../b
1242 pushing to ../b
1237 query 1; heads
1243 query 1; heads
1238 searching for changes
1244 searching for changes
1239 all remote heads known locally
1245 all remote heads known locally
1240 listing keys for "bookmarks"
1246 listing keys for "bookmarks"
1241 3 changesets found
1247 3 changesets found
1242 list of changesets:
1248 list of changesets:
1243 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1249 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1244 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1250 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1245 911600dab2ae7a9baff75958b84fe606851ce955
1251 911600dab2ae7a9baff75958b84fe606851ce955
1246 adding changesets
1252 adding changesets
1247 bundling: 1/3 changesets (33.33%)
1253 bundling: 1/3 changesets (33.33%)
1248 bundling: 2/3 changesets (66.67%)
1254 bundling: 2/3 changesets (66.67%)
1249 bundling: 3/3 changesets (100.00%)
1255 bundling: 3/3 changesets (100.00%)
1250 bundling: 1/3 manifests (33.33%)
1256 bundling: 1/3 manifests (33.33%)
1251 bundling: 2/3 manifests (66.67%)
1257 bundling: 2/3 manifests (66.67%)
1252 bundling: 3/3 manifests (100.00%)
1258 bundling: 3/3 manifests (100.00%)
1253 bundling: foo/Bar/file.txt 1/3 files (33.33%)
1259 bundling: foo/Bar/file.txt 1/3 files (33.33%)
1254 bundling: foo/file.txt 2/3 files (66.67%)
1260 bundling: foo/file.txt 2/3 files (66.67%)
1255 bundling: quux/file.py 3/3 files (100.00%)
1261 bundling: quux/file.py 3/3 files (100.00%)
1256 changesets: 1 chunks
1262 changesets: 1 chunks
1257 add changeset ef1ea85a6374
1263 add changeset ef1ea85a6374
1258 changesets: 2 chunks
1264 changesets: 2 chunks
1259 add changeset f9cafe1212c8
1265 add changeset f9cafe1212c8
1260 changesets: 3 chunks
1266 changesets: 3 chunks
1261 add changeset 911600dab2ae
1267 add changeset 911600dab2ae
1262 adding manifests
1268 adding manifests
1263 manifests: 1/3 chunks (33.33%)
1269 manifests: 1/3 chunks (33.33%)
1264 manifests: 2/3 chunks (66.67%)
1270 manifests: 2/3 chunks (66.67%)
1265 manifests: 3/3 chunks (100.00%)
1271 manifests: 3/3 chunks (100.00%)
1266 adding file changes
1272 adding file changes
1267 adding foo/Bar/file.txt revisions
1273 adding foo/Bar/file.txt revisions
1268 files: 1/3 chunks (33.33%)
1274 files: 1/3 chunks (33.33%)
1269 adding foo/file.txt revisions
1275 adding foo/file.txt revisions
1270 files: 2/3 chunks (66.67%)
1276 files: 2/3 chunks (66.67%)
1271 adding quux/file.py revisions
1277 adding quux/file.py revisions
1272 files: 3/3 chunks (100.00%)
1278 files: 3/3 chunks (100.00%)
1273 added 3 changesets with 3 changes to 3 files
1279 added 3 changesets with 3 changes to 3 files
1274 calling hook pretxnchangegroup.acl: hgext.acl.hook
1280 calling hook pretxnchangegroup.acl: hgext.acl.hook
1275 acl: checking access for user "fred"
1281 acl: checking access for user "fred"
1276 acl: acl.allow.branches not enabled
1282 acl: acl.allow.branches not enabled
1277 acl: acl.deny.branches not enabled
1283 acl: acl.deny.branches not enabled
1278 acl: "group1" not defined in [acl.groups]
1284 acl: "group1" not defined in [acl.groups]
1279 acl: acl.allow enabled, 1 entries for user fred
1285 acl: acl.allow enabled, 1 entries for user fred
1280 acl: acl.deny not enabled
1286 acl: acl.deny not enabled
1281 acl: branch access granted: "ef1ea85a6374" on branch "default"
1287 acl: branch access granted: "ef1ea85a6374" on branch "default"
1282 acl: path access granted: "ef1ea85a6374"
1288 acl: path access granted: "ef1ea85a6374"
1283 acl: branch access granted: "f9cafe1212c8" on branch "default"
1289 acl: branch access granted: "f9cafe1212c8" on branch "default"
1284 acl: path access granted: "f9cafe1212c8"
1290 acl: path access granted: "f9cafe1212c8"
1285 acl: branch access granted: "911600dab2ae" on branch "default"
1291 acl: branch access granted: "911600dab2ae" on branch "default"
1286 acl: path access granted: "911600dab2ae"
1292 acl: path access granted: "911600dab2ae"
1287 listing keys for "phases"
1293 listing keys for "phases"
1288 try to push obsolete markers to remote
1294 try to push obsolete markers to remote
1289 updating the branch cache
1295 updating the branch cache
1290 checking for updated bookmarks
1296 checking for updated bookmarks
1291 listing keys for "bookmarks"
1297 listing keys for "bookmarks"
1292 repository tip rolled back to revision 0 (undo push)
1298 repository tip rolled back to revision 0 (undo push)
1293 0:6675d58eff77
1299 0:6675d58eff77
1294
1300
1295
1301
1296 $ echo '[acl.deny]' >> $config
1302 $ echo '[acl.deny]' >> $config
1297 $ echo "foo/Bar/** = @group1" >> $config
1303 $ echo "foo/Bar/** = @group1" >> $config
1298
1304
1299 @group is allowed inside anything but foo/Bar/
1305 @group is allowed inside anything but foo/Bar/
1300
1306
1301 $ do_push fred
1307 $ do_push fred
1302 Pushing as user fred
1308 Pushing as user fred
1303 hgrc = """
1309 hgrc = """
1304 [acl]
1310 [acl]
1305 sources = push
1311 sources = push
1306 [extensions]
1312 [extensions]
1307 [acl.allow]
1313 [acl.allow]
1308 ** = @group1
1314 ** = @group1
1309 [acl.deny]
1315 [acl.deny]
1310 foo/Bar/** = @group1
1316 foo/Bar/** = @group1
1311 """
1317 """
1312 pushing to ../b
1318 pushing to ../b
1313 query 1; heads
1319 query 1; heads
1314 searching for changes
1320 searching for changes
1315 all remote heads known locally
1321 all remote heads known locally
1322 invalid branchheads cache (unserved): tip differs
1316 listing keys for "bookmarks"
1323 listing keys for "bookmarks"
1317 3 changesets found
1324 3 changesets found
1318 list of changesets:
1325 list of changesets:
1319 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1326 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1320 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1327 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1321 911600dab2ae7a9baff75958b84fe606851ce955
1328 911600dab2ae7a9baff75958b84fe606851ce955
1322 adding changesets
1329 adding changesets
1323 bundling: 1/3 changesets (33.33%)
1330 bundling: 1/3 changesets (33.33%)
1324 bundling: 2/3 changesets (66.67%)
1331 bundling: 2/3 changesets (66.67%)
1325 bundling: 3/3 changesets (100.00%)
1332 bundling: 3/3 changesets (100.00%)
1326 bundling: 1/3 manifests (33.33%)
1333 bundling: 1/3 manifests (33.33%)
1327 bundling: 2/3 manifests (66.67%)
1334 bundling: 2/3 manifests (66.67%)
1328 bundling: 3/3 manifests (100.00%)
1335 bundling: 3/3 manifests (100.00%)
1329 bundling: foo/Bar/file.txt 1/3 files (33.33%)
1336 bundling: foo/Bar/file.txt 1/3 files (33.33%)
1330 bundling: foo/file.txt 2/3 files (66.67%)
1337 bundling: foo/file.txt 2/3 files (66.67%)
1331 bundling: quux/file.py 3/3 files (100.00%)
1338 bundling: quux/file.py 3/3 files (100.00%)
1332 changesets: 1 chunks
1339 changesets: 1 chunks
1333 add changeset ef1ea85a6374
1340 add changeset ef1ea85a6374
1334 changesets: 2 chunks
1341 changesets: 2 chunks
1335 add changeset f9cafe1212c8
1342 add changeset f9cafe1212c8
1336 changesets: 3 chunks
1343 changesets: 3 chunks
1337 add changeset 911600dab2ae
1344 add changeset 911600dab2ae
1338 adding manifests
1345 adding manifests
1339 manifests: 1/3 chunks (33.33%)
1346 manifests: 1/3 chunks (33.33%)
1340 manifests: 2/3 chunks (66.67%)
1347 manifests: 2/3 chunks (66.67%)
1341 manifests: 3/3 chunks (100.00%)
1348 manifests: 3/3 chunks (100.00%)
1342 adding file changes
1349 adding file changes
1343 adding foo/Bar/file.txt revisions
1350 adding foo/Bar/file.txt revisions
1344 files: 1/3 chunks (33.33%)
1351 files: 1/3 chunks (33.33%)
1345 adding foo/file.txt revisions
1352 adding foo/file.txt revisions
1346 files: 2/3 chunks (66.67%)
1353 files: 2/3 chunks (66.67%)
1347 adding quux/file.py revisions
1354 adding quux/file.py revisions
1348 files: 3/3 chunks (100.00%)
1355 files: 3/3 chunks (100.00%)
1349 added 3 changesets with 3 changes to 3 files
1356 added 3 changesets with 3 changes to 3 files
1350 calling hook pretxnchangegroup.acl: hgext.acl.hook
1357 calling hook pretxnchangegroup.acl: hgext.acl.hook
1351 acl: checking access for user "fred"
1358 acl: checking access for user "fred"
1352 acl: acl.allow.branches not enabled
1359 acl: acl.allow.branches not enabled
1353 acl: acl.deny.branches not enabled
1360 acl: acl.deny.branches not enabled
1354 acl: "group1" not defined in [acl.groups]
1361 acl: "group1" not defined in [acl.groups]
1355 acl: acl.allow enabled, 1 entries for user fred
1362 acl: acl.allow enabled, 1 entries for user fred
1356 acl: "group1" not defined in [acl.groups]
1363 acl: "group1" not defined in [acl.groups]
1357 acl: acl.deny enabled, 1 entries for user fred
1364 acl: acl.deny enabled, 1 entries for user fred
1358 acl: branch access granted: "ef1ea85a6374" on branch "default"
1365 acl: branch access granted: "ef1ea85a6374" on branch "default"
1359 acl: path access granted: "ef1ea85a6374"
1366 acl: path access granted: "ef1ea85a6374"
1360 acl: branch access granted: "f9cafe1212c8" on branch "default"
1367 acl: branch access granted: "f9cafe1212c8" on branch "default"
1361 error: pretxnchangegroup.acl hook failed: acl: user "fred" denied on "foo/Bar/file.txt" (changeset "f9cafe1212c8")
1368 error: pretxnchangegroup.acl hook failed: acl: user "fred" denied on "foo/Bar/file.txt" (changeset "f9cafe1212c8")
1362 transaction abort!
1369 transaction abort!
1363 rollback completed
1370 rollback completed
1364 abort: acl: user "fred" denied on "foo/Bar/file.txt" (changeset "f9cafe1212c8")
1371 abort: acl: user "fred" denied on "foo/Bar/file.txt" (changeset "f9cafe1212c8")
1365 no rollback information available
1372 no rollback information available
1366 0:6675d58eff77
1373 0:6675d58eff77
1367
1374
1368
1375
1369 Invalid group
1376 Invalid group
1370
1377
1371 Disable the fakegroups trick to get real failures
1378 Disable the fakegroups trick to get real failures
1372
1379
1373 $ grep -v fakegroups $config > config.tmp
1380 $ grep -v fakegroups $config > config.tmp
1374 $ mv config.tmp $config
1381 $ mv config.tmp $config
1375 $ echo '[acl.allow]' >> $config
1382 $ echo '[acl.allow]' >> $config
1376 $ echo "** = @unlikelytoexist" >> $config
1383 $ echo "** = @unlikelytoexist" >> $config
1377 $ do_push fred 2>&1 | grep unlikelytoexist
1384 $ do_push fred 2>&1 | grep unlikelytoexist
1378 ** = @unlikelytoexist
1385 ** = @unlikelytoexist
1379 acl: "unlikelytoexist" not defined in [acl.groups]
1386 acl: "unlikelytoexist" not defined in [acl.groups]
1380 error: pretxnchangegroup.acl hook failed: group 'unlikelytoexist' is undefined
1387 error: pretxnchangegroup.acl hook failed: group 'unlikelytoexist' is undefined
1381 abort: group 'unlikelytoexist' is undefined
1388 abort: group 'unlikelytoexist' is undefined
1382
1389
1383
1390
1384 Branch acl tests setup
1391 Branch acl tests setup
1385
1392
1386 $ init_config
1393 $ init_config
1387 $ cd b
1394 $ cd b
1388 $ hg up
1395 $ hg up
1389 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1396 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1390 $ hg branch foobar
1397 $ hg branch foobar
1391 marked working directory as branch foobar
1398 marked working directory as branch foobar
1392 (branches are permanent and global, did you want a bookmark?)
1399 (branches are permanent and global, did you want a bookmark?)
1393 $ hg commit -m 'create foobar'
1400 $ hg commit -m 'create foobar'
1394 $ echo 'foo contents' > abc.txt
1401 $ echo 'foo contents' > abc.txt
1395 $ hg add abc.txt
1402 $ hg add abc.txt
1396 $ hg commit -m 'foobar contents'
1403 $ hg commit -m 'foobar contents'
1397 $ cd ..
1404 $ cd ..
1398 $ hg --cwd a pull ../b
1405 $ hg --cwd a pull ../b
1399 pulling from ../b
1406 pulling from ../b
1400 searching for changes
1407 searching for changes
1401 adding changesets
1408 adding changesets
1402 adding manifests
1409 adding manifests
1403 adding file changes
1410 adding file changes
1404 added 2 changesets with 1 changes to 1 files (+1 heads)
1411 added 2 changesets with 1 changes to 1 files (+1 heads)
1405 (run 'hg heads' to see heads)
1412 (run 'hg heads' to see heads)
1406
1413
1407 Create additional changeset on foobar branch
1414 Create additional changeset on foobar branch
1408
1415
1409 $ cd a
1416 $ cd a
1410 $ hg up -C foobar
1417 $ hg up -C foobar
1411 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
1418 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
1412 $ echo 'foo contents2' > abc.txt
1419 $ echo 'foo contents2' > abc.txt
1413 $ hg commit -m 'foobar contents2'
1420 $ hg commit -m 'foobar contents2'
1414 $ cd ..
1421 $ cd ..
1415
1422
1416
1423
1417 No branch acls specified
1424 No branch acls specified
1418
1425
1419 $ do_push astro
1426 $ do_push astro
1420 Pushing as user astro
1427 Pushing as user astro
1421 hgrc = """
1428 hgrc = """
1422 [acl]
1429 [acl]
1423 sources = push
1430 sources = push
1424 [extensions]
1431 [extensions]
1425 """
1432 """
1426 pushing to ../b
1433 pushing to ../b
1427 query 1; heads
1434 query 1; heads
1428 searching for changes
1435 searching for changes
1429 all remote heads known locally
1436 all remote heads known locally
1430 listing keys for "bookmarks"
1437 listing keys for "bookmarks"
1431 4 changesets found
1438 4 changesets found
1432 list of changesets:
1439 list of changesets:
1433 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1440 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1434 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1441 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1435 911600dab2ae7a9baff75958b84fe606851ce955
1442 911600dab2ae7a9baff75958b84fe606851ce955
1436 e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
1443 e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
1437 adding changesets
1444 adding changesets
1438 bundling: 1/4 changesets (25.00%)
1445 bundling: 1/4 changesets (25.00%)
1439 bundling: 2/4 changesets (50.00%)
1446 bundling: 2/4 changesets (50.00%)
1440 bundling: 3/4 changesets (75.00%)
1447 bundling: 3/4 changesets (75.00%)
1441 bundling: 4/4 changesets (100.00%)
1448 bundling: 4/4 changesets (100.00%)
1442 bundling: 1/4 manifests (25.00%)
1449 bundling: 1/4 manifests (25.00%)
1443 bundling: 2/4 manifests (50.00%)
1450 bundling: 2/4 manifests (50.00%)
1444 bundling: 3/4 manifests (75.00%)
1451 bundling: 3/4 manifests (75.00%)
1445 bundling: 4/4 manifests (100.00%)
1452 bundling: 4/4 manifests (100.00%)
1446 bundling: abc.txt 1/4 files (25.00%)
1453 bundling: abc.txt 1/4 files (25.00%)
1447 bundling: foo/Bar/file.txt 2/4 files (50.00%)
1454 bundling: foo/Bar/file.txt 2/4 files (50.00%)
1448 bundling: foo/file.txt 3/4 files (75.00%)
1455 bundling: foo/file.txt 3/4 files (75.00%)
1449 bundling: quux/file.py 4/4 files (100.00%)
1456 bundling: quux/file.py 4/4 files (100.00%)
1450 changesets: 1 chunks
1457 changesets: 1 chunks
1451 add changeset ef1ea85a6374
1458 add changeset ef1ea85a6374
1452 changesets: 2 chunks
1459 changesets: 2 chunks
1453 add changeset f9cafe1212c8
1460 add changeset f9cafe1212c8
1454 changesets: 3 chunks
1461 changesets: 3 chunks
1455 add changeset 911600dab2ae
1462 add changeset 911600dab2ae
1456 changesets: 4 chunks
1463 changesets: 4 chunks
1457 add changeset e8fc755d4d82
1464 add changeset e8fc755d4d82
1458 adding manifests
1465 adding manifests
1459 manifests: 1/4 chunks (25.00%)
1466 manifests: 1/4 chunks (25.00%)
1460 manifests: 2/4 chunks (50.00%)
1467 manifests: 2/4 chunks (50.00%)
1461 manifests: 3/4 chunks (75.00%)
1468 manifests: 3/4 chunks (75.00%)
1462 manifests: 4/4 chunks (100.00%)
1469 manifests: 4/4 chunks (100.00%)
1463 adding file changes
1470 adding file changes
1464 adding abc.txt revisions
1471 adding abc.txt revisions
1465 files: 1/4 chunks (25.00%)
1472 files: 1/4 chunks (25.00%)
1466 adding foo/Bar/file.txt revisions
1473 adding foo/Bar/file.txt revisions
1467 files: 2/4 chunks (50.00%)
1474 files: 2/4 chunks (50.00%)
1468 adding foo/file.txt revisions
1475 adding foo/file.txt revisions
1469 files: 3/4 chunks (75.00%)
1476 files: 3/4 chunks (75.00%)
1470 adding quux/file.py revisions
1477 adding quux/file.py revisions
1471 files: 4/4 chunks (100.00%)
1478 files: 4/4 chunks (100.00%)
1472 added 4 changesets with 4 changes to 4 files (+1 heads)
1479 added 4 changesets with 4 changes to 4 files (+1 heads)
1473 calling hook pretxnchangegroup.acl: hgext.acl.hook
1480 calling hook pretxnchangegroup.acl: hgext.acl.hook
1474 acl: checking access for user "astro"
1481 acl: checking access for user "astro"
1475 acl: acl.allow.branches not enabled
1482 acl: acl.allow.branches not enabled
1476 acl: acl.deny.branches not enabled
1483 acl: acl.deny.branches not enabled
1477 acl: acl.allow not enabled
1484 acl: acl.allow not enabled
1478 acl: acl.deny not enabled
1485 acl: acl.deny not enabled
1479 acl: branch access granted: "ef1ea85a6374" on branch "default"
1486 acl: branch access granted: "ef1ea85a6374" on branch "default"
1480 acl: path access granted: "ef1ea85a6374"
1487 acl: path access granted: "ef1ea85a6374"
1481 acl: branch access granted: "f9cafe1212c8" on branch "default"
1488 acl: branch access granted: "f9cafe1212c8" on branch "default"
1482 acl: path access granted: "f9cafe1212c8"
1489 acl: path access granted: "f9cafe1212c8"
1483 acl: branch access granted: "911600dab2ae" on branch "default"
1490 acl: branch access granted: "911600dab2ae" on branch "default"
1484 acl: path access granted: "911600dab2ae"
1491 acl: path access granted: "911600dab2ae"
1485 acl: branch access granted: "e8fc755d4d82" on branch "foobar"
1492 acl: branch access granted: "e8fc755d4d82" on branch "foobar"
1486 acl: path access granted: "e8fc755d4d82"
1493 acl: path access granted: "e8fc755d4d82"
1487 listing keys for "phases"
1494 listing keys for "phases"
1488 try to push obsolete markers to remote
1495 try to push obsolete markers to remote
1489 updating the branch cache
1496 updating the branch cache
1490 checking for updated bookmarks
1497 checking for updated bookmarks
1491 listing keys for "bookmarks"
1498 listing keys for "bookmarks"
1492 repository tip rolled back to revision 2 (undo push)
1499 repository tip rolled back to revision 2 (undo push)
1493 2:fb35475503ef
1500 2:fb35475503ef
1494
1501
1495
1502
1496 Branch acl deny test
1503 Branch acl deny test
1497
1504
1498 $ echo "[acl.deny.branches]" >> $config
1505 $ echo "[acl.deny.branches]" >> $config
1499 $ echo "foobar = *" >> $config
1506 $ echo "foobar = *" >> $config
1500 $ do_push astro
1507 $ do_push astro
1501 Pushing as user astro
1508 Pushing as user astro
1502 hgrc = """
1509 hgrc = """
1503 [acl]
1510 [acl]
1504 sources = push
1511 sources = push
1505 [extensions]
1512 [extensions]
1506 [acl.deny.branches]
1513 [acl.deny.branches]
1507 foobar = *
1514 foobar = *
1508 """
1515 """
1509 pushing to ../b
1516 pushing to ../b
1510 query 1; heads
1517 query 1; heads
1511 searching for changes
1518 searching for changes
1512 all remote heads known locally
1519 all remote heads known locally
1520 invalid branchheads cache (unserved): tip differs
1513 listing keys for "bookmarks"
1521 listing keys for "bookmarks"
1514 4 changesets found
1522 4 changesets found
1515 list of changesets:
1523 list of changesets:
1516 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1524 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1517 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1525 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1518 911600dab2ae7a9baff75958b84fe606851ce955
1526 911600dab2ae7a9baff75958b84fe606851ce955
1519 e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
1527 e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
1520 adding changesets
1528 adding changesets
1521 bundling: 1/4 changesets (25.00%)
1529 bundling: 1/4 changesets (25.00%)
1522 bundling: 2/4 changesets (50.00%)
1530 bundling: 2/4 changesets (50.00%)
1523 bundling: 3/4 changesets (75.00%)
1531 bundling: 3/4 changesets (75.00%)
1524 bundling: 4/4 changesets (100.00%)
1532 bundling: 4/4 changesets (100.00%)
1525 bundling: 1/4 manifests (25.00%)
1533 bundling: 1/4 manifests (25.00%)
1526 bundling: 2/4 manifests (50.00%)
1534 bundling: 2/4 manifests (50.00%)
1527 bundling: 3/4 manifests (75.00%)
1535 bundling: 3/4 manifests (75.00%)
1528 bundling: 4/4 manifests (100.00%)
1536 bundling: 4/4 manifests (100.00%)
1529 bundling: abc.txt 1/4 files (25.00%)
1537 bundling: abc.txt 1/4 files (25.00%)
1530 bundling: foo/Bar/file.txt 2/4 files (50.00%)
1538 bundling: foo/Bar/file.txt 2/4 files (50.00%)
1531 bundling: foo/file.txt 3/4 files (75.00%)
1539 bundling: foo/file.txt 3/4 files (75.00%)
1532 bundling: quux/file.py 4/4 files (100.00%)
1540 bundling: quux/file.py 4/4 files (100.00%)
1533 changesets: 1 chunks
1541 changesets: 1 chunks
1534 add changeset ef1ea85a6374
1542 add changeset ef1ea85a6374
1535 changesets: 2 chunks
1543 changesets: 2 chunks
1536 add changeset f9cafe1212c8
1544 add changeset f9cafe1212c8
1537 changesets: 3 chunks
1545 changesets: 3 chunks
1538 add changeset 911600dab2ae
1546 add changeset 911600dab2ae
1539 changesets: 4 chunks
1547 changesets: 4 chunks
1540 add changeset e8fc755d4d82
1548 add changeset e8fc755d4d82
1541 adding manifests
1549 adding manifests
1542 manifests: 1/4 chunks (25.00%)
1550 manifests: 1/4 chunks (25.00%)
1543 manifests: 2/4 chunks (50.00%)
1551 manifests: 2/4 chunks (50.00%)
1544 manifests: 3/4 chunks (75.00%)
1552 manifests: 3/4 chunks (75.00%)
1545 manifests: 4/4 chunks (100.00%)
1553 manifests: 4/4 chunks (100.00%)
1546 adding file changes
1554 adding file changes
1547 adding abc.txt revisions
1555 adding abc.txt revisions
1548 files: 1/4 chunks (25.00%)
1556 files: 1/4 chunks (25.00%)
1549 adding foo/Bar/file.txt revisions
1557 adding foo/Bar/file.txt revisions
1550 files: 2/4 chunks (50.00%)
1558 files: 2/4 chunks (50.00%)
1551 adding foo/file.txt revisions
1559 adding foo/file.txt revisions
1552 files: 3/4 chunks (75.00%)
1560 files: 3/4 chunks (75.00%)
1553 adding quux/file.py revisions
1561 adding quux/file.py revisions
1554 files: 4/4 chunks (100.00%)
1562 files: 4/4 chunks (100.00%)
1555 added 4 changesets with 4 changes to 4 files (+1 heads)
1563 added 4 changesets with 4 changes to 4 files (+1 heads)
1556 calling hook pretxnchangegroup.acl: hgext.acl.hook
1564 calling hook pretxnchangegroup.acl: hgext.acl.hook
1557 acl: checking access for user "astro"
1565 acl: checking access for user "astro"
1558 acl: acl.allow.branches not enabled
1566 acl: acl.allow.branches not enabled
1559 acl: acl.deny.branches enabled, 1 entries for user astro
1567 acl: acl.deny.branches enabled, 1 entries for user astro
1560 acl: acl.allow not enabled
1568 acl: acl.allow not enabled
1561 acl: acl.deny not enabled
1569 acl: acl.deny not enabled
1562 acl: branch access granted: "ef1ea85a6374" on branch "default"
1570 acl: branch access granted: "ef1ea85a6374" on branch "default"
1563 acl: path access granted: "ef1ea85a6374"
1571 acl: path access granted: "ef1ea85a6374"
1564 acl: branch access granted: "f9cafe1212c8" on branch "default"
1572 acl: branch access granted: "f9cafe1212c8" on branch "default"
1565 acl: path access granted: "f9cafe1212c8"
1573 acl: path access granted: "f9cafe1212c8"
1566 acl: branch access granted: "911600dab2ae" on branch "default"
1574 acl: branch access granted: "911600dab2ae" on branch "default"
1567 acl: path access granted: "911600dab2ae"
1575 acl: path access granted: "911600dab2ae"
1568 error: pretxnchangegroup.acl hook failed: acl: user "astro" denied on branch "foobar" (changeset "e8fc755d4d82")
1576 error: pretxnchangegroup.acl hook failed: acl: user "astro" denied on branch "foobar" (changeset "e8fc755d4d82")
1569 transaction abort!
1577 transaction abort!
1570 rollback completed
1578 rollback completed
1571 abort: acl: user "astro" denied on branch "foobar" (changeset "e8fc755d4d82")
1579 abort: acl: user "astro" denied on branch "foobar" (changeset "e8fc755d4d82")
1572 no rollback information available
1580 no rollback information available
1573 2:fb35475503ef
1581 2:fb35475503ef
1574
1582
1575
1583
1576 Branch acl empty allow test
1584 Branch acl empty allow test
1577
1585
1578 $ init_config
1586 $ init_config
1579 $ echo "[acl.allow.branches]" >> $config
1587 $ echo "[acl.allow.branches]" >> $config
1580 $ do_push astro
1588 $ do_push astro
1581 Pushing as user astro
1589 Pushing as user astro
1582 hgrc = """
1590 hgrc = """
1583 [acl]
1591 [acl]
1584 sources = push
1592 sources = push
1585 [extensions]
1593 [extensions]
1586 [acl.allow.branches]
1594 [acl.allow.branches]
1587 """
1595 """
1588 pushing to ../b
1596 pushing to ../b
1589 query 1; heads
1597 query 1; heads
1590 searching for changes
1598 searching for changes
1591 all remote heads known locally
1599 all remote heads known locally
1592 listing keys for "bookmarks"
1600 listing keys for "bookmarks"
1593 4 changesets found
1601 4 changesets found
1594 list of changesets:
1602 list of changesets:
1595 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1603 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1596 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1604 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1597 911600dab2ae7a9baff75958b84fe606851ce955
1605 911600dab2ae7a9baff75958b84fe606851ce955
1598 e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
1606 e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
1599 adding changesets
1607 adding changesets
1600 bundling: 1/4 changesets (25.00%)
1608 bundling: 1/4 changesets (25.00%)
1601 bundling: 2/4 changesets (50.00%)
1609 bundling: 2/4 changesets (50.00%)
1602 bundling: 3/4 changesets (75.00%)
1610 bundling: 3/4 changesets (75.00%)
1603 bundling: 4/4 changesets (100.00%)
1611 bundling: 4/4 changesets (100.00%)
1604 bundling: 1/4 manifests (25.00%)
1612 bundling: 1/4 manifests (25.00%)
1605 bundling: 2/4 manifests (50.00%)
1613 bundling: 2/4 manifests (50.00%)
1606 bundling: 3/4 manifests (75.00%)
1614 bundling: 3/4 manifests (75.00%)
1607 bundling: 4/4 manifests (100.00%)
1615 bundling: 4/4 manifests (100.00%)
1608 bundling: abc.txt 1/4 files (25.00%)
1616 bundling: abc.txt 1/4 files (25.00%)
1609 bundling: foo/Bar/file.txt 2/4 files (50.00%)
1617 bundling: foo/Bar/file.txt 2/4 files (50.00%)
1610 bundling: foo/file.txt 3/4 files (75.00%)
1618 bundling: foo/file.txt 3/4 files (75.00%)
1611 bundling: quux/file.py 4/4 files (100.00%)
1619 bundling: quux/file.py 4/4 files (100.00%)
1612 changesets: 1 chunks
1620 changesets: 1 chunks
1613 add changeset ef1ea85a6374
1621 add changeset ef1ea85a6374
1614 changesets: 2 chunks
1622 changesets: 2 chunks
1615 add changeset f9cafe1212c8
1623 add changeset f9cafe1212c8
1616 changesets: 3 chunks
1624 changesets: 3 chunks
1617 add changeset 911600dab2ae
1625 add changeset 911600dab2ae
1618 changesets: 4 chunks
1626 changesets: 4 chunks
1619 add changeset e8fc755d4d82
1627 add changeset e8fc755d4d82
1620 adding manifests
1628 adding manifests
1621 manifests: 1/4 chunks (25.00%)
1629 manifests: 1/4 chunks (25.00%)
1622 manifests: 2/4 chunks (50.00%)
1630 manifests: 2/4 chunks (50.00%)
1623 manifests: 3/4 chunks (75.00%)
1631 manifests: 3/4 chunks (75.00%)
1624 manifests: 4/4 chunks (100.00%)
1632 manifests: 4/4 chunks (100.00%)
1625 adding file changes
1633 adding file changes
1626 adding abc.txt revisions
1634 adding abc.txt revisions
1627 files: 1/4 chunks (25.00%)
1635 files: 1/4 chunks (25.00%)
1628 adding foo/Bar/file.txt revisions
1636 adding foo/Bar/file.txt revisions
1629 files: 2/4 chunks (50.00%)
1637 files: 2/4 chunks (50.00%)
1630 adding foo/file.txt revisions
1638 adding foo/file.txt revisions
1631 files: 3/4 chunks (75.00%)
1639 files: 3/4 chunks (75.00%)
1632 adding quux/file.py revisions
1640 adding quux/file.py revisions
1633 files: 4/4 chunks (100.00%)
1641 files: 4/4 chunks (100.00%)
1634 added 4 changesets with 4 changes to 4 files (+1 heads)
1642 added 4 changesets with 4 changes to 4 files (+1 heads)
1635 calling hook pretxnchangegroup.acl: hgext.acl.hook
1643 calling hook pretxnchangegroup.acl: hgext.acl.hook
1636 acl: checking access for user "astro"
1644 acl: checking access for user "astro"
1637 acl: acl.allow.branches enabled, 0 entries for user astro
1645 acl: acl.allow.branches enabled, 0 entries for user astro
1638 acl: acl.deny.branches not enabled
1646 acl: acl.deny.branches not enabled
1639 acl: acl.allow not enabled
1647 acl: acl.allow not enabled
1640 acl: acl.deny not enabled
1648 acl: acl.deny not enabled
1641 error: pretxnchangegroup.acl hook failed: acl: user "astro" not allowed on branch "default" (changeset "ef1ea85a6374")
1649 error: pretxnchangegroup.acl hook failed: acl: user "astro" not allowed on branch "default" (changeset "ef1ea85a6374")
1642 transaction abort!
1650 transaction abort!
1643 rollback completed
1651 rollback completed
1644 abort: acl: user "astro" not allowed on branch "default" (changeset "ef1ea85a6374")
1652 abort: acl: user "astro" not allowed on branch "default" (changeset "ef1ea85a6374")
1645 no rollback information available
1653 no rollback information available
1646 2:fb35475503ef
1654 2:fb35475503ef
1647
1655
1648
1656
1649 Branch acl allow other
1657 Branch acl allow other
1650
1658
1651 $ init_config
1659 $ init_config
1652 $ echo "[acl.allow.branches]" >> $config
1660 $ echo "[acl.allow.branches]" >> $config
1653 $ echo "* = george" >> $config
1661 $ echo "* = george" >> $config
1654 $ do_push astro
1662 $ do_push astro
1655 Pushing as user astro
1663 Pushing as user astro
1656 hgrc = """
1664 hgrc = """
1657 [acl]
1665 [acl]
1658 sources = push
1666 sources = push
1659 [extensions]
1667 [extensions]
1660 [acl.allow.branches]
1668 [acl.allow.branches]
1661 * = george
1669 * = george
1662 """
1670 """
1663 pushing to ../b
1671 pushing to ../b
1664 query 1; heads
1672 query 1; heads
1665 searching for changes
1673 searching for changes
1666 all remote heads known locally
1674 all remote heads known locally
1667 listing keys for "bookmarks"
1675 listing keys for "bookmarks"
1668 4 changesets found
1676 4 changesets found
1669 list of changesets:
1677 list of changesets:
1670 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1678 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1671 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1679 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1672 911600dab2ae7a9baff75958b84fe606851ce955
1680 911600dab2ae7a9baff75958b84fe606851ce955
1673 e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
1681 e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
1674 adding changesets
1682 adding changesets
1675 bundling: 1/4 changesets (25.00%)
1683 bundling: 1/4 changesets (25.00%)
1676 bundling: 2/4 changesets (50.00%)
1684 bundling: 2/4 changesets (50.00%)
1677 bundling: 3/4 changesets (75.00%)
1685 bundling: 3/4 changesets (75.00%)
1678 bundling: 4/4 changesets (100.00%)
1686 bundling: 4/4 changesets (100.00%)
1679 bundling: 1/4 manifests (25.00%)
1687 bundling: 1/4 manifests (25.00%)
1680 bundling: 2/4 manifests (50.00%)
1688 bundling: 2/4 manifests (50.00%)
1681 bundling: 3/4 manifests (75.00%)
1689 bundling: 3/4 manifests (75.00%)
1682 bundling: 4/4 manifests (100.00%)
1690 bundling: 4/4 manifests (100.00%)
1683 bundling: abc.txt 1/4 files (25.00%)
1691 bundling: abc.txt 1/4 files (25.00%)
1684 bundling: foo/Bar/file.txt 2/4 files (50.00%)
1692 bundling: foo/Bar/file.txt 2/4 files (50.00%)
1685 bundling: foo/file.txt 3/4 files (75.00%)
1693 bundling: foo/file.txt 3/4 files (75.00%)
1686 bundling: quux/file.py 4/4 files (100.00%)
1694 bundling: quux/file.py 4/4 files (100.00%)
1687 changesets: 1 chunks
1695 changesets: 1 chunks
1688 add changeset ef1ea85a6374
1696 add changeset ef1ea85a6374
1689 changesets: 2 chunks
1697 changesets: 2 chunks
1690 add changeset f9cafe1212c8
1698 add changeset f9cafe1212c8
1691 changesets: 3 chunks
1699 changesets: 3 chunks
1692 add changeset 911600dab2ae
1700 add changeset 911600dab2ae
1693 changesets: 4 chunks
1701 changesets: 4 chunks
1694 add changeset e8fc755d4d82
1702 add changeset e8fc755d4d82
1695 adding manifests
1703 adding manifests
1696 manifests: 1/4 chunks (25.00%)
1704 manifests: 1/4 chunks (25.00%)
1697 manifests: 2/4 chunks (50.00%)
1705 manifests: 2/4 chunks (50.00%)
1698 manifests: 3/4 chunks (75.00%)
1706 manifests: 3/4 chunks (75.00%)
1699 manifests: 4/4 chunks (100.00%)
1707 manifests: 4/4 chunks (100.00%)
1700 adding file changes
1708 adding file changes
1701 adding abc.txt revisions
1709 adding abc.txt revisions
1702 files: 1/4 chunks (25.00%)
1710 files: 1/4 chunks (25.00%)
1703 adding foo/Bar/file.txt revisions
1711 adding foo/Bar/file.txt revisions
1704 files: 2/4 chunks (50.00%)
1712 files: 2/4 chunks (50.00%)
1705 adding foo/file.txt revisions
1713 adding foo/file.txt revisions
1706 files: 3/4 chunks (75.00%)
1714 files: 3/4 chunks (75.00%)
1707 adding quux/file.py revisions
1715 adding quux/file.py revisions
1708 files: 4/4 chunks (100.00%)
1716 files: 4/4 chunks (100.00%)
1709 added 4 changesets with 4 changes to 4 files (+1 heads)
1717 added 4 changesets with 4 changes to 4 files (+1 heads)
1710 calling hook pretxnchangegroup.acl: hgext.acl.hook
1718 calling hook pretxnchangegroup.acl: hgext.acl.hook
1711 acl: checking access for user "astro"
1719 acl: checking access for user "astro"
1712 acl: acl.allow.branches enabled, 0 entries for user astro
1720 acl: acl.allow.branches enabled, 0 entries for user astro
1713 acl: acl.deny.branches not enabled
1721 acl: acl.deny.branches not enabled
1714 acl: acl.allow not enabled
1722 acl: acl.allow not enabled
1715 acl: acl.deny not enabled
1723 acl: acl.deny not enabled
1716 error: pretxnchangegroup.acl hook failed: acl: user "astro" not allowed on branch "default" (changeset "ef1ea85a6374")
1724 error: pretxnchangegroup.acl hook failed: acl: user "astro" not allowed on branch "default" (changeset "ef1ea85a6374")
1717 transaction abort!
1725 transaction abort!
1718 rollback completed
1726 rollback completed
1719 abort: acl: user "astro" not allowed on branch "default" (changeset "ef1ea85a6374")
1727 abort: acl: user "astro" not allowed on branch "default" (changeset "ef1ea85a6374")
1720 no rollback information available
1728 no rollback information available
1721 2:fb35475503ef
1729 2:fb35475503ef
1722
1730
1723 $ do_push george
1731 $ do_push george
1724 Pushing as user george
1732 Pushing as user george
1725 hgrc = """
1733 hgrc = """
1726 [acl]
1734 [acl]
1727 sources = push
1735 sources = push
1728 [extensions]
1736 [extensions]
1729 [acl.allow.branches]
1737 [acl.allow.branches]
1730 * = george
1738 * = george
1731 """
1739 """
1732 pushing to ../b
1740 pushing to ../b
1733 query 1; heads
1741 query 1; heads
1734 searching for changes
1742 searching for changes
1735 all remote heads known locally
1743 all remote heads known locally
1736 listing keys for "bookmarks"
1744 listing keys for "bookmarks"
1737 4 changesets found
1745 4 changesets found
1738 list of changesets:
1746 list of changesets:
1739 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1747 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1740 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1748 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1741 911600dab2ae7a9baff75958b84fe606851ce955
1749 911600dab2ae7a9baff75958b84fe606851ce955
1742 e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
1750 e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
1743 adding changesets
1751 adding changesets
1744 bundling: 1/4 changesets (25.00%)
1752 bundling: 1/4 changesets (25.00%)
1745 bundling: 2/4 changesets (50.00%)
1753 bundling: 2/4 changesets (50.00%)
1746 bundling: 3/4 changesets (75.00%)
1754 bundling: 3/4 changesets (75.00%)
1747 bundling: 4/4 changesets (100.00%)
1755 bundling: 4/4 changesets (100.00%)
1748 bundling: 1/4 manifests (25.00%)
1756 bundling: 1/4 manifests (25.00%)
1749 bundling: 2/4 manifests (50.00%)
1757 bundling: 2/4 manifests (50.00%)
1750 bundling: 3/4 manifests (75.00%)
1758 bundling: 3/4 manifests (75.00%)
1751 bundling: 4/4 manifests (100.00%)
1759 bundling: 4/4 manifests (100.00%)
1752 bundling: abc.txt 1/4 files (25.00%)
1760 bundling: abc.txt 1/4 files (25.00%)
1753 bundling: foo/Bar/file.txt 2/4 files (50.00%)
1761 bundling: foo/Bar/file.txt 2/4 files (50.00%)
1754 bundling: foo/file.txt 3/4 files (75.00%)
1762 bundling: foo/file.txt 3/4 files (75.00%)
1755 bundling: quux/file.py 4/4 files (100.00%)
1763 bundling: quux/file.py 4/4 files (100.00%)
1756 changesets: 1 chunks
1764 changesets: 1 chunks
1757 add changeset ef1ea85a6374
1765 add changeset ef1ea85a6374
1758 changesets: 2 chunks
1766 changesets: 2 chunks
1759 add changeset f9cafe1212c8
1767 add changeset f9cafe1212c8
1760 changesets: 3 chunks
1768 changesets: 3 chunks
1761 add changeset 911600dab2ae
1769 add changeset 911600dab2ae
1762 changesets: 4 chunks
1770 changesets: 4 chunks
1763 add changeset e8fc755d4d82
1771 add changeset e8fc755d4d82
1764 adding manifests
1772 adding manifests
1765 manifests: 1/4 chunks (25.00%)
1773 manifests: 1/4 chunks (25.00%)
1766 manifests: 2/4 chunks (50.00%)
1774 manifests: 2/4 chunks (50.00%)
1767 manifests: 3/4 chunks (75.00%)
1775 manifests: 3/4 chunks (75.00%)
1768 manifests: 4/4 chunks (100.00%)
1776 manifests: 4/4 chunks (100.00%)
1769 adding file changes
1777 adding file changes
1770 adding abc.txt revisions
1778 adding abc.txt revisions
1771 files: 1/4 chunks (25.00%)
1779 files: 1/4 chunks (25.00%)
1772 adding foo/Bar/file.txt revisions
1780 adding foo/Bar/file.txt revisions
1773 files: 2/4 chunks (50.00%)
1781 files: 2/4 chunks (50.00%)
1774 adding foo/file.txt revisions
1782 adding foo/file.txt revisions
1775 files: 3/4 chunks (75.00%)
1783 files: 3/4 chunks (75.00%)
1776 adding quux/file.py revisions
1784 adding quux/file.py revisions
1777 files: 4/4 chunks (100.00%)
1785 files: 4/4 chunks (100.00%)
1778 added 4 changesets with 4 changes to 4 files (+1 heads)
1786 added 4 changesets with 4 changes to 4 files (+1 heads)
1779 calling hook pretxnchangegroup.acl: hgext.acl.hook
1787 calling hook pretxnchangegroup.acl: hgext.acl.hook
1780 acl: checking access for user "george"
1788 acl: checking access for user "george"
1781 acl: acl.allow.branches enabled, 1 entries for user george
1789 acl: acl.allow.branches enabled, 1 entries for user george
1782 acl: acl.deny.branches not enabled
1790 acl: acl.deny.branches not enabled
1783 acl: acl.allow not enabled
1791 acl: acl.allow not enabled
1784 acl: acl.deny not enabled
1792 acl: acl.deny not enabled
1785 acl: branch access granted: "ef1ea85a6374" on branch "default"
1793 acl: branch access granted: "ef1ea85a6374" on branch "default"
1786 acl: path access granted: "ef1ea85a6374"
1794 acl: path access granted: "ef1ea85a6374"
1787 acl: branch access granted: "f9cafe1212c8" on branch "default"
1795 acl: branch access granted: "f9cafe1212c8" on branch "default"
1788 acl: path access granted: "f9cafe1212c8"
1796 acl: path access granted: "f9cafe1212c8"
1789 acl: branch access granted: "911600dab2ae" on branch "default"
1797 acl: branch access granted: "911600dab2ae" on branch "default"
1790 acl: path access granted: "911600dab2ae"
1798 acl: path access granted: "911600dab2ae"
1791 acl: branch access granted: "e8fc755d4d82" on branch "foobar"
1799 acl: branch access granted: "e8fc755d4d82" on branch "foobar"
1792 acl: path access granted: "e8fc755d4d82"
1800 acl: path access granted: "e8fc755d4d82"
1793 listing keys for "phases"
1801 listing keys for "phases"
1794 try to push obsolete markers to remote
1802 try to push obsolete markers to remote
1795 updating the branch cache
1803 updating the branch cache
1796 checking for updated bookmarks
1804 checking for updated bookmarks
1797 listing keys for "bookmarks"
1805 listing keys for "bookmarks"
1798 repository tip rolled back to revision 2 (undo push)
1806 repository tip rolled back to revision 2 (undo push)
1799 2:fb35475503ef
1807 2:fb35475503ef
1800
1808
1801
1809
1802 Branch acl conflicting allow
1810 Branch acl conflicting allow
1803 asterisk ends up applying to all branches and allowing george to
1811 asterisk ends up applying to all branches and allowing george to
1804 push foobar into the remote
1812 push foobar into the remote
1805
1813
1806 $ init_config
1814 $ init_config
1807 $ echo "[acl.allow.branches]" >> $config
1815 $ echo "[acl.allow.branches]" >> $config
1808 $ echo "foobar = astro" >> $config
1816 $ echo "foobar = astro" >> $config
1809 $ echo "* = george" >> $config
1817 $ echo "* = george" >> $config
1810 $ do_push george
1818 $ do_push george
1811 Pushing as user george
1819 Pushing as user george
1812 hgrc = """
1820 hgrc = """
1813 [acl]
1821 [acl]
1814 sources = push
1822 sources = push
1815 [extensions]
1823 [extensions]
1816 [acl.allow.branches]
1824 [acl.allow.branches]
1817 foobar = astro
1825 foobar = astro
1818 * = george
1826 * = george
1819 """
1827 """
1820 pushing to ../b
1828 pushing to ../b
1821 query 1; heads
1829 query 1; heads
1822 searching for changes
1830 searching for changes
1823 all remote heads known locally
1831 all remote heads known locally
1832 invalid branchheads cache (unserved): tip differs
1824 listing keys for "bookmarks"
1833 listing keys for "bookmarks"
1825 4 changesets found
1834 4 changesets found
1826 list of changesets:
1835 list of changesets:
1827 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1836 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1828 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1837 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1829 911600dab2ae7a9baff75958b84fe606851ce955
1838 911600dab2ae7a9baff75958b84fe606851ce955
1830 e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
1839 e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
1831 adding changesets
1840 adding changesets
1832 bundling: 1/4 changesets (25.00%)
1841 bundling: 1/4 changesets (25.00%)
1833 bundling: 2/4 changesets (50.00%)
1842 bundling: 2/4 changesets (50.00%)
1834 bundling: 3/4 changesets (75.00%)
1843 bundling: 3/4 changesets (75.00%)
1835 bundling: 4/4 changesets (100.00%)
1844 bundling: 4/4 changesets (100.00%)
1836 bundling: 1/4 manifests (25.00%)
1845 bundling: 1/4 manifests (25.00%)
1837 bundling: 2/4 manifests (50.00%)
1846 bundling: 2/4 manifests (50.00%)
1838 bundling: 3/4 manifests (75.00%)
1847 bundling: 3/4 manifests (75.00%)
1839 bundling: 4/4 manifests (100.00%)
1848 bundling: 4/4 manifests (100.00%)
1840 bundling: abc.txt 1/4 files (25.00%)
1849 bundling: abc.txt 1/4 files (25.00%)
1841 bundling: foo/Bar/file.txt 2/4 files (50.00%)
1850 bundling: foo/Bar/file.txt 2/4 files (50.00%)
1842 bundling: foo/file.txt 3/4 files (75.00%)
1851 bundling: foo/file.txt 3/4 files (75.00%)
1843 bundling: quux/file.py 4/4 files (100.00%)
1852 bundling: quux/file.py 4/4 files (100.00%)
1844 changesets: 1 chunks
1853 changesets: 1 chunks
1845 add changeset ef1ea85a6374
1854 add changeset ef1ea85a6374
1846 changesets: 2 chunks
1855 changesets: 2 chunks
1847 add changeset f9cafe1212c8
1856 add changeset f9cafe1212c8
1848 changesets: 3 chunks
1857 changesets: 3 chunks
1849 add changeset 911600dab2ae
1858 add changeset 911600dab2ae
1850 changesets: 4 chunks
1859 changesets: 4 chunks
1851 add changeset e8fc755d4d82
1860 add changeset e8fc755d4d82
1852 adding manifests
1861 adding manifests
1853 manifests: 1/4 chunks (25.00%)
1862 manifests: 1/4 chunks (25.00%)
1854 manifests: 2/4 chunks (50.00%)
1863 manifests: 2/4 chunks (50.00%)
1855 manifests: 3/4 chunks (75.00%)
1864 manifests: 3/4 chunks (75.00%)
1856 manifests: 4/4 chunks (100.00%)
1865 manifests: 4/4 chunks (100.00%)
1857 adding file changes
1866 adding file changes
1858 adding abc.txt revisions
1867 adding abc.txt revisions
1859 files: 1/4 chunks (25.00%)
1868 files: 1/4 chunks (25.00%)
1860 adding foo/Bar/file.txt revisions
1869 adding foo/Bar/file.txt revisions
1861 files: 2/4 chunks (50.00%)
1870 files: 2/4 chunks (50.00%)
1862 adding foo/file.txt revisions
1871 adding foo/file.txt revisions
1863 files: 3/4 chunks (75.00%)
1872 files: 3/4 chunks (75.00%)
1864 adding quux/file.py revisions
1873 adding quux/file.py revisions
1865 files: 4/4 chunks (100.00%)
1874 files: 4/4 chunks (100.00%)
1866 added 4 changesets with 4 changes to 4 files (+1 heads)
1875 added 4 changesets with 4 changes to 4 files (+1 heads)
1867 calling hook pretxnchangegroup.acl: hgext.acl.hook
1876 calling hook pretxnchangegroup.acl: hgext.acl.hook
1868 acl: checking access for user "george"
1877 acl: checking access for user "george"
1869 acl: acl.allow.branches enabled, 1 entries for user george
1878 acl: acl.allow.branches enabled, 1 entries for user george
1870 acl: acl.deny.branches not enabled
1879 acl: acl.deny.branches not enabled
1871 acl: acl.allow not enabled
1880 acl: acl.allow not enabled
1872 acl: acl.deny not enabled
1881 acl: acl.deny not enabled
1873 acl: branch access granted: "ef1ea85a6374" on branch "default"
1882 acl: branch access granted: "ef1ea85a6374" on branch "default"
1874 acl: path access granted: "ef1ea85a6374"
1883 acl: path access granted: "ef1ea85a6374"
1875 acl: branch access granted: "f9cafe1212c8" on branch "default"
1884 acl: branch access granted: "f9cafe1212c8" on branch "default"
1876 acl: path access granted: "f9cafe1212c8"
1885 acl: path access granted: "f9cafe1212c8"
1877 acl: branch access granted: "911600dab2ae" on branch "default"
1886 acl: branch access granted: "911600dab2ae" on branch "default"
1878 acl: path access granted: "911600dab2ae"
1887 acl: path access granted: "911600dab2ae"
1879 acl: branch access granted: "e8fc755d4d82" on branch "foobar"
1888 acl: branch access granted: "e8fc755d4d82" on branch "foobar"
1880 acl: path access granted: "e8fc755d4d82"
1889 acl: path access granted: "e8fc755d4d82"
1881 listing keys for "phases"
1890 listing keys for "phases"
1882 try to push obsolete markers to remote
1891 try to push obsolete markers to remote
1883 updating the branch cache
1892 updating the branch cache
1884 checking for updated bookmarks
1893 checking for updated bookmarks
1885 listing keys for "bookmarks"
1894 listing keys for "bookmarks"
1886 repository tip rolled back to revision 2 (undo push)
1895 repository tip rolled back to revision 2 (undo push)
1887 2:fb35475503ef
1896 2:fb35475503ef
1888
1897
1889 Branch acl conflicting deny
1898 Branch acl conflicting deny
1890
1899
1891 $ init_config
1900 $ init_config
1892 $ echo "[acl.deny.branches]" >> $config
1901 $ echo "[acl.deny.branches]" >> $config
1893 $ echo "foobar = astro" >> $config
1902 $ echo "foobar = astro" >> $config
1894 $ echo "default = astro" >> $config
1903 $ echo "default = astro" >> $config
1895 $ echo "* = george" >> $config
1904 $ echo "* = george" >> $config
1896 $ do_push george
1905 $ do_push george
1897 Pushing as user george
1906 Pushing as user george
1898 hgrc = """
1907 hgrc = """
1899 [acl]
1908 [acl]
1900 sources = push
1909 sources = push
1901 [extensions]
1910 [extensions]
1902 [acl.deny.branches]
1911 [acl.deny.branches]
1903 foobar = astro
1912 foobar = astro
1904 default = astro
1913 default = astro
1905 * = george
1914 * = george
1906 """
1915 """
1907 pushing to ../b
1916 pushing to ../b
1908 query 1; heads
1917 query 1; heads
1909 searching for changes
1918 searching for changes
1910 all remote heads known locally
1919 all remote heads known locally
1920 invalid branchheads cache (unserved): tip differs
1911 listing keys for "bookmarks"
1921 listing keys for "bookmarks"
1912 4 changesets found
1922 4 changesets found
1913 list of changesets:
1923 list of changesets:
1914 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1924 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1915 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1925 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1916 911600dab2ae7a9baff75958b84fe606851ce955
1926 911600dab2ae7a9baff75958b84fe606851ce955
1917 e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
1927 e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
1918 adding changesets
1928 adding changesets
1919 bundling: 1/4 changesets (25.00%)
1929 bundling: 1/4 changesets (25.00%)
1920 bundling: 2/4 changesets (50.00%)
1930 bundling: 2/4 changesets (50.00%)
1921 bundling: 3/4 changesets (75.00%)
1931 bundling: 3/4 changesets (75.00%)
1922 bundling: 4/4 changesets (100.00%)
1932 bundling: 4/4 changesets (100.00%)
1923 bundling: 1/4 manifests (25.00%)
1933 bundling: 1/4 manifests (25.00%)
1924 bundling: 2/4 manifests (50.00%)
1934 bundling: 2/4 manifests (50.00%)
1925 bundling: 3/4 manifests (75.00%)
1935 bundling: 3/4 manifests (75.00%)
1926 bundling: 4/4 manifests (100.00%)
1936 bundling: 4/4 manifests (100.00%)
1927 bundling: abc.txt 1/4 files (25.00%)
1937 bundling: abc.txt 1/4 files (25.00%)
1928 bundling: foo/Bar/file.txt 2/4 files (50.00%)
1938 bundling: foo/Bar/file.txt 2/4 files (50.00%)
1929 bundling: foo/file.txt 3/4 files (75.00%)
1939 bundling: foo/file.txt 3/4 files (75.00%)
1930 bundling: quux/file.py 4/4 files (100.00%)
1940 bundling: quux/file.py 4/4 files (100.00%)
1931 changesets: 1 chunks
1941 changesets: 1 chunks
1932 add changeset ef1ea85a6374
1942 add changeset ef1ea85a6374
1933 changesets: 2 chunks
1943 changesets: 2 chunks
1934 add changeset f9cafe1212c8
1944 add changeset f9cafe1212c8
1935 changesets: 3 chunks
1945 changesets: 3 chunks
1936 add changeset 911600dab2ae
1946 add changeset 911600dab2ae
1937 changesets: 4 chunks
1947 changesets: 4 chunks
1938 add changeset e8fc755d4d82
1948 add changeset e8fc755d4d82
1939 adding manifests
1949 adding manifests
1940 manifests: 1/4 chunks (25.00%)
1950 manifests: 1/4 chunks (25.00%)
1941 manifests: 2/4 chunks (50.00%)
1951 manifests: 2/4 chunks (50.00%)
1942 manifests: 3/4 chunks (75.00%)
1952 manifests: 3/4 chunks (75.00%)
1943 manifests: 4/4 chunks (100.00%)
1953 manifests: 4/4 chunks (100.00%)
1944 adding file changes
1954 adding file changes
1945 adding abc.txt revisions
1955 adding abc.txt revisions
1946 files: 1/4 chunks (25.00%)
1956 files: 1/4 chunks (25.00%)
1947 adding foo/Bar/file.txt revisions
1957 adding foo/Bar/file.txt revisions
1948 files: 2/4 chunks (50.00%)
1958 files: 2/4 chunks (50.00%)
1949 adding foo/file.txt revisions
1959 adding foo/file.txt revisions
1950 files: 3/4 chunks (75.00%)
1960 files: 3/4 chunks (75.00%)
1951 adding quux/file.py revisions
1961 adding quux/file.py revisions
1952 files: 4/4 chunks (100.00%)
1962 files: 4/4 chunks (100.00%)
1953 added 4 changesets with 4 changes to 4 files (+1 heads)
1963 added 4 changesets with 4 changes to 4 files (+1 heads)
1954 calling hook pretxnchangegroup.acl: hgext.acl.hook
1964 calling hook pretxnchangegroup.acl: hgext.acl.hook
1955 acl: checking access for user "george"
1965 acl: checking access for user "george"
1956 acl: acl.allow.branches not enabled
1966 acl: acl.allow.branches not enabled
1957 acl: acl.deny.branches enabled, 1 entries for user george
1967 acl: acl.deny.branches enabled, 1 entries for user george
1958 acl: acl.allow not enabled
1968 acl: acl.allow not enabled
1959 acl: acl.deny not enabled
1969 acl: acl.deny not enabled
1960 error: pretxnchangegroup.acl hook failed: acl: user "george" denied on branch "default" (changeset "ef1ea85a6374")
1970 error: pretxnchangegroup.acl hook failed: acl: user "george" denied on branch "default" (changeset "ef1ea85a6374")
1961 transaction abort!
1971 transaction abort!
1962 rollback completed
1972 rollback completed
1963 abort: acl: user "george" denied on branch "default" (changeset "ef1ea85a6374")
1973 abort: acl: user "george" denied on branch "default" (changeset "ef1ea85a6374")
1964 no rollback information available
1974 no rollback information available
1965 2:fb35475503ef
1975 2:fb35475503ef
1966
1976
1967 User 'astro' must not be denied
1977 User 'astro' must not be denied
1968
1978
1969 $ init_config
1979 $ init_config
1970 $ echo "[acl.deny.branches]" >> $config
1980 $ echo "[acl.deny.branches]" >> $config
1971 $ echo "default = !astro" >> $config
1981 $ echo "default = !astro" >> $config
1972 $ do_push astro
1982 $ do_push astro
1973 Pushing as user astro
1983 Pushing as user astro
1974 hgrc = """
1984 hgrc = """
1975 [acl]
1985 [acl]
1976 sources = push
1986 sources = push
1977 [extensions]
1987 [extensions]
1978 [acl.deny.branches]
1988 [acl.deny.branches]
1979 default = !astro
1989 default = !astro
1980 """
1990 """
1981 pushing to ../b
1991 pushing to ../b
1982 query 1; heads
1992 query 1; heads
1983 searching for changes
1993 searching for changes
1984 all remote heads known locally
1994 all remote heads known locally
1985 listing keys for "bookmarks"
1995 listing keys for "bookmarks"
1986 4 changesets found
1996 4 changesets found
1987 list of changesets:
1997 list of changesets:
1988 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1998 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1989 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1999 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1990 911600dab2ae7a9baff75958b84fe606851ce955
2000 911600dab2ae7a9baff75958b84fe606851ce955
1991 e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
2001 e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
1992 adding changesets
2002 adding changesets
1993 bundling: 1/4 changesets (25.00%)
2003 bundling: 1/4 changesets (25.00%)
1994 bundling: 2/4 changesets (50.00%)
2004 bundling: 2/4 changesets (50.00%)
1995 bundling: 3/4 changesets (75.00%)
2005 bundling: 3/4 changesets (75.00%)
1996 bundling: 4/4 changesets (100.00%)
2006 bundling: 4/4 changesets (100.00%)
1997 bundling: 1/4 manifests (25.00%)
2007 bundling: 1/4 manifests (25.00%)
1998 bundling: 2/4 manifests (50.00%)
2008 bundling: 2/4 manifests (50.00%)
1999 bundling: 3/4 manifests (75.00%)
2009 bundling: 3/4 manifests (75.00%)
2000 bundling: 4/4 manifests (100.00%)
2010 bundling: 4/4 manifests (100.00%)
2001 bundling: abc.txt 1/4 files (25.00%)
2011 bundling: abc.txt 1/4 files (25.00%)
2002 bundling: foo/Bar/file.txt 2/4 files (50.00%)
2012 bundling: foo/Bar/file.txt 2/4 files (50.00%)
2003 bundling: foo/file.txt 3/4 files (75.00%)
2013 bundling: foo/file.txt 3/4 files (75.00%)
2004 bundling: quux/file.py 4/4 files (100.00%)
2014 bundling: quux/file.py 4/4 files (100.00%)
2005 changesets: 1 chunks
2015 changesets: 1 chunks
2006 add changeset ef1ea85a6374
2016 add changeset ef1ea85a6374
2007 changesets: 2 chunks
2017 changesets: 2 chunks
2008 add changeset f9cafe1212c8
2018 add changeset f9cafe1212c8
2009 changesets: 3 chunks
2019 changesets: 3 chunks
2010 add changeset 911600dab2ae
2020 add changeset 911600dab2ae
2011 changesets: 4 chunks
2021 changesets: 4 chunks
2012 add changeset e8fc755d4d82
2022 add changeset e8fc755d4d82
2013 adding manifests
2023 adding manifests
2014 manifests: 1/4 chunks (25.00%)
2024 manifests: 1/4 chunks (25.00%)
2015 manifests: 2/4 chunks (50.00%)
2025 manifests: 2/4 chunks (50.00%)
2016 manifests: 3/4 chunks (75.00%)
2026 manifests: 3/4 chunks (75.00%)
2017 manifests: 4/4 chunks (100.00%)
2027 manifests: 4/4 chunks (100.00%)
2018 adding file changes
2028 adding file changes
2019 adding abc.txt revisions
2029 adding abc.txt revisions
2020 files: 1/4 chunks (25.00%)
2030 files: 1/4 chunks (25.00%)
2021 adding foo/Bar/file.txt revisions
2031 adding foo/Bar/file.txt revisions
2022 files: 2/4 chunks (50.00%)
2032 files: 2/4 chunks (50.00%)
2023 adding foo/file.txt revisions
2033 adding foo/file.txt revisions
2024 files: 3/4 chunks (75.00%)
2034 files: 3/4 chunks (75.00%)
2025 adding quux/file.py revisions
2035 adding quux/file.py revisions
2026 files: 4/4 chunks (100.00%)
2036 files: 4/4 chunks (100.00%)
2027 added 4 changesets with 4 changes to 4 files (+1 heads)
2037 added 4 changesets with 4 changes to 4 files (+1 heads)
2028 calling hook pretxnchangegroup.acl: hgext.acl.hook
2038 calling hook pretxnchangegroup.acl: hgext.acl.hook
2029 acl: checking access for user "astro"
2039 acl: checking access for user "astro"
2030 acl: acl.allow.branches not enabled
2040 acl: acl.allow.branches not enabled
2031 acl: acl.deny.branches enabled, 0 entries for user astro
2041 acl: acl.deny.branches enabled, 0 entries for user astro
2032 acl: acl.allow not enabled
2042 acl: acl.allow not enabled
2033 acl: acl.deny not enabled
2043 acl: acl.deny not enabled
2034 acl: branch access granted: "ef1ea85a6374" on branch "default"
2044 acl: branch access granted: "ef1ea85a6374" on branch "default"
2035 acl: path access granted: "ef1ea85a6374"
2045 acl: path access granted: "ef1ea85a6374"
2036 acl: branch access granted: "f9cafe1212c8" on branch "default"
2046 acl: branch access granted: "f9cafe1212c8" on branch "default"
2037 acl: path access granted: "f9cafe1212c8"
2047 acl: path access granted: "f9cafe1212c8"
2038 acl: branch access granted: "911600dab2ae" on branch "default"
2048 acl: branch access granted: "911600dab2ae" on branch "default"
2039 acl: path access granted: "911600dab2ae"
2049 acl: path access granted: "911600dab2ae"
2040 acl: branch access granted: "e8fc755d4d82" on branch "foobar"
2050 acl: branch access granted: "e8fc755d4d82" on branch "foobar"
2041 acl: path access granted: "e8fc755d4d82"
2051 acl: path access granted: "e8fc755d4d82"
2042 listing keys for "phases"
2052 listing keys for "phases"
2043 try to push obsolete markers to remote
2053 try to push obsolete markers to remote
2044 updating the branch cache
2054 updating the branch cache
2045 checking for updated bookmarks
2055 checking for updated bookmarks
2046 listing keys for "bookmarks"
2056 listing keys for "bookmarks"
2047 repository tip rolled back to revision 2 (undo push)
2057 repository tip rolled back to revision 2 (undo push)
2048 2:fb35475503ef
2058 2:fb35475503ef
2049
2059
2050
2060
2051 Non-astro users must be denied
2061 Non-astro users must be denied
2052
2062
2053 $ do_push george
2063 $ do_push george
2054 Pushing as user george
2064 Pushing as user george
2055 hgrc = """
2065 hgrc = """
2056 [acl]
2066 [acl]
2057 sources = push
2067 sources = push
2058 [extensions]
2068 [extensions]
2059 [acl.deny.branches]
2069 [acl.deny.branches]
2060 default = !astro
2070 default = !astro
2061 """
2071 """
2062 pushing to ../b
2072 pushing to ../b
2063 query 1; heads
2073 query 1; heads
2064 searching for changes
2074 searching for changes
2065 all remote heads known locally
2075 all remote heads known locally
2076 invalid branchheads cache (unserved): tip differs
2066 listing keys for "bookmarks"
2077 listing keys for "bookmarks"
2067 4 changesets found
2078 4 changesets found
2068 list of changesets:
2079 list of changesets:
2069 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
2080 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
2070 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
2081 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
2071 911600dab2ae7a9baff75958b84fe606851ce955
2082 911600dab2ae7a9baff75958b84fe606851ce955
2072 e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
2083 e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
2073 adding changesets
2084 adding changesets
2074 bundling: 1/4 changesets (25.00%)
2085 bundling: 1/4 changesets (25.00%)
2075 bundling: 2/4 changesets (50.00%)
2086 bundling: 2/4 changesets (50.00%)
2076 bundling: 3/4 changesets (75.00%)
2087 bundling: 3/4 changesets (75.00%)
2077 bundling: 4/4 changesets (100.00%)
2088 bundling: 4/4 changesets (100.00%)
2078 bundling: 1/4 manifests (25.00%)
2089 bundling: 1/4 manifests (25.00%)
2079 bundling: 2/4 manifests (50.00%)
2090 bundling: 2/4 manifests (50.00%)
2080 bundling: 3/4 manifests (75.00%)
2091 bundling: 3/4 manifests (75.00%)
2081 bundling: 4/4 manifests (100.00%)
2092 bundling: 4/4 manifests (100.00%)
2082 bundling: abc.txt 1/4 files (25.00%)
2093 bundling: abc.txt 1/4 files (25.00%)
2083 bundling: foo/Bar/file.txt 2/4 files (50.00%)
2094 bundling: foo/Bar/file.txt 2/4 files (50.00%)
2084 bundling: foo/file.txt 3/4 files (75.00%)
2095 bundling: foo/file.txt 3/4 files (75.00%)
2085 bundling: quux/file.py 4/4 files (100.00%)
2096 bundling: quux/file.py 4/4 files (100.00%)
2086 changesets: 1 chunks
2097 changesets: 1 chunks
2087 add changeset ef1ea85a6374
2098 add changeset ef1ea85a6374
2088 changesets: 2 chunks
2099 changesets: 2 chunks
2089 add changeset f9cafe1212c8
2100 add changeset f9cafe1212c8
2090 changesets: 3 chunks
2101 changesets: 3 chunks
2091 add changeset 911600dab2ae
2102 add changeset 911600dab2ae
2092 changesets: 4 chunks
2103 changesets: 4 chunks
2093 add changeset e8fc755d4d82
2104 add changeset e8fc755d4d82
2094 adding manifests
2105 adding manifests
2095 manifests: 1/4 chunks (25.00%)
2106 manifests: 1/4 chunks (25.00%)
2096 manifests: 2/4 chunks (50.00%)
2107 manifests: 2/4 chunks (50.00%)
2097 manifests: 3/4 chunks (75.00%)
2108 manifests: 3/4 chunks (75.00%)
2098 manifests: 4/4 chunks (100.00%)
2109 manifests: 4/4 chunks (100.00%)
2099 adding file changes
2110 adding file changes
2100 adding abc.txt revisions
2111 adding abc.txt revisions
2101 files: 1/4 chunks (25.00%)
2112 files: 1/4 chunks (25.00%)
2102 adding foo/Bar/file.txt revisions
2113 adding foo/Bar/file.txt revisions
2103 files: 2/4 chunks (50.00%)
2114 files: 2/4 chunks (50.00%)
2104 adding foo/file.txt revisions
2115 adding foo/file.txt revisions
2105 files: 3/4 chunks (75.00%)
2116 files: 3/4 chunks (75.00%)
2106 adding quux/file.py revisions
2117 adding quux/file.py revisions
2107 files: 4/4 chunks (100.00%)
2118 files: 4/4 chunks (100.00%)
2108 added 4 changesets with 4 changes to 4 files (+1 heads)
2119 added 4 changesets with 4 changes to 4 files (+1 heads)
2109 calling hook pretxnchangegroup.acl: hgext.acl.hook
2120 calling hook pretxnchangegroup.acl: hgext.acl.hook
2110 acl: checking access for user "george"
2121 acl: checking access for user "george"
2111 acl: acl.allow.branches not enabled
2122 acl: acl.allow.branches not enabled
2112 acl: acl.deny.branches enabled, 1 entries for user george
2123 acl: acl.deny.branches enabled, 1 entries for user george
2113 acl: acl.allow not enabled
2124 acl: acl.allow not enabled
2114 acl: acl.deny not enabled
2125 acl: acl.deny not enabled
2115 error: pretxnchangegroup.acl hook failed: acl: user "george" denied on branch "default" (changeset "ef1ea85a6374")
2126 error: pretxnchangegroup.acl hook failed: acl: user "george" denied on branch "default" (changeset "ef1ea85a6374")
2116 transaction abort!
2127 transaction abort!
2117 rollback completed
2128 rollback completed
2118 abort: acl: user "george" denied on branch "default" (changeset "ef1ea85a6374")
2129 abort: acl: user "george" denied on branch "default" (changeset "ef1ea85a6374")
2119 no rollback information available
2130 no rollback information available
2120 2:fb35475503ef
2131 2:fb35475503ef
2121
2132
2122
2133
@@ -1,180 +1,180 b''
1 Init repo1:
1 Init repo1:
2
2
3 $ hg init repo1
3 $ hg init repo1
4 $ cd repo1
4 $ cd repo1
5 $ echo "some text" > a
5 $ echo "some text" > a
6 $ hg add
6 $ hg add
7 adding a
7 adding a
8 $ hg ci -m first
8 $ hg ci -m first
9 $ cat .hg/store/fncache | sort
9 $ cat .hg/store/fncache | sort
10 data/a.i
10 data/a.i
11
11
12 Testing a.i/b:
12 Testing a.i/b:
13
13
14 $ mkdir a.i
14 $ mkdir a.i
15 $ echo "some other text" > a.i/b
15 $ echo "some other text" > a.i/b
16 $ hg add
16 $ hg add
17 adding a.i/b (glob)
17 adding a.i/b (glob)
18 $ hg ci -m second
18 $ hg ci -m second
19 $ cat .hg/store/fncache | sort
19 $ cat .hg/store/fncache | sort
20 data/a.i
20 data/a.i
21 data/a.i.hg/b.i
21 data/a.i.hg/b.i
22
22
23 Testing a.i.hg/c:
23 Testing a.i.hg/c:
24
24
25 $ mkdir a.i.hg
25 $ mkdir a.i.hg
26 $ echo "yet another text" > a.i.hg/c
26 $ echo "yet another text" > a.i.hg/c
27 $ hg add
27 $ hg add
28 adding a.i.hg/c (glob)
28 adding a.i.hg/c (glob)
29 $ hg ci -m third
29 $ hg ci -m third
30 $ cat .hg/store/fncache | sort
30 $ cat .hg/store/fncache | sort
31 data/a.i
31 data/a.i
32 data/a.i.hg.hg/c.i
32 data/a.i.hg.hg/c.i
33 data/a.i.hg/b.i
33 data/a.i.hg/b.i
34
34
35 Testing verify:
35 Testing verify:
36
36
37 $ hg verify
37 $ hg verify
38 checking changesets
38 checking changesets
39 checking manifests
39 checking manifests
40 crosschecking files in changesets and manifests
40 crosschecking files in changesets and manifests
41 checking files
41 checking files
42 3 files, 3 changesets, 3 total revisions
42 3 files, 3 changesets, 3 total revisions
43
43
44 $ rm .hg/store/fncache
44 $ rm .hg/store/fncache
45
45
46 $ hg verify
46 $ hg verify
47 checking changesets
47 checking changesets
48 checking manifests
48 checking manifests
49 crosschecking files in changesets and manifests
49 crosschecking files in changesets and manifests
50 checking files
50 checking files
51 data/a.i@0: missing revlog!
51 data/a.i@0: missing revlog!
52 data/a.i.hg/c.i@2: missing revlog!
52 data/a.i.hg/c.i@2: missing revlog!
53 data/a.i/b.i@1: missing revlog!
53 data/a.i/b.i@1: missing revlog!
54 3 files, 3 changesets, 3 total revisions
54 3 files, 3 changesets, 3 total revisions
55 3 integrity errors encountered!
55 3 integrity errors encountered!
56 (first damaged changeset appears to be 0)
56 (first damaged changeset appears to be 0)
57 [1]
57 [1]
58 $ cd ..
58 $ cd ..
59
59
60 Non store repo:
60 Non store repo:
61
61
62 $ hg --config format.usestore=False init foo
62 $ hg --config format.usestore=False init foo
63 $ cd foo
63 $ cd foo
64 $ mkdir tst.d
64 $ mkdir tst.d
65 $ echo foo > tst.d/foo
65 $ echo foo > tst.d/foo
66 $ hg ci -Amfoo
66 $ hg ci -Amfoo
67 adding tst.d/foo
67 adding tst.d/foo
68 $ find .hg | sort
68 $ find .hg | sort
69 .hg
69 .hg
70 .hg/00changelog.i
70 .hg/00changelog.i
71 .hg/00manifest.i
71 .hg/00manifest.i
72 .hg/cache
72 .hg/cache
73 .hg/cache/branchheads
73 .hg/cache/branchheads-unserved
74 .hg/data
74 .hg/data
75 .hg/data/tst.d.hg
75 .hg/data/tst.d.hg
76 .hg/data/tst.d.hg/foo.i
76 .hg/data/tst.d.hg/foo.i
77 .hg/dirstate
77 .hg/dirstate
78 .hg/last-message.txt
78 .hg/last-message.txt
79 .hg/phaseroots
79 .hg/phaseroots
80 .hg/requires
80 .hg/requires
81 .hg/undo
81 .hg/undo
82 .hg/undo.bookmarks
82 .hg/undo.bookmarks
83 .hg/undo.branch
83 .hg/undo.branch
84 .hg/undo.desc
84 .hg/undo.desc
85 .hg/undo.dirstate
85 .hg/undo.dirstate
86 .hg/undo.phaseroots
86 .hg/undo.phaseroots
87 $ cd ..
87 $ cd ..
88
88
89 Non fncache repo:
89 Non fncache repo:
90
90
91 $ hg --config format.usefncache=False init bar
91 $ hg --config format.usefncache=False init bar
92 $ cd bar
92 $ cd bar
93 $ mkdir tst.d
93 $ mkdir tst.d
94 $ echo foo > tst.d/Foo
94 $ echo foo > tst.d/Foo
95 $ hg ci -Amfoo
95 $ hg ci -Amfoo
96 adding tst.d/Foo
96 adding tst.d/Foo
97 $ find .hg | sort
97 $ find .hg | sort
98 .hg
98 .hg
99 .hg/00changelog.i
99 .hg/00changelog.i
100 .hg/cache
100 .hg/cache
101 .hg/cache/branchheads
101 .hg/cache/branchheads-unserved
102 .hg/dirstate
102 .hg/dirstate
103 .hg/last-message.txt
103 .hg/last-message.txt
104 .hg/requires
104 .hg/requires
105 .hg/store
105 .hg/store
106 .hg/store/00changelog.i
106 .hg/store/00changelog.i
107 .hg/store/00manifest.i
107 .hg/store/00manifest.i
108 .hg/store/data
108 .hg/store/data
109 .hg/store/data/tst.d.hg
109 .hg/store/data/tst.d.hg
110 .hg/store/data/tst.d.hg/_foo.i
110 .hg/store/data/tst.d.hg/_foo.i
111 .hg/store/phaseroots
111 .hg/store/phaseroots
112 .hg/store/undo
112 .hg/store/undo
113 .hg/store/undo.phaseroots
113 .hg/store/undo.phaseroots
114 .hg/undo.bookmarks
114 .hg/undo.bookmarks
115 .hg/undo.branch
115 .hg/undo.branch
116 .hg/undo.desc
116 .hg/undo.desc
117 .hg/undo.dirstate
117 .hg/undo.dirstate
118 $ cd ..
118 $ cd ..
119
119
120 Encoding of reserved / long paths in the store
120 Encoding of reserved / long paths in the store
121
121
122 $ hg init r2
122 $ hg init r2
123 $ cd r2
123 $ cd r2
124 $ cat <<EOF > .hg/hgrc
124 $ cat <<EOF > .hg/hgrc
125 > [ui]
125 > [ui]
126 > portablefilenames = ignore
126 > portablefilenames = ignore
127 > EOF
127 > EOF
128
128
129 $ hg import -q --bypass - <<EOF
129 $ hg import -q --bypass - <<EOF
130 > # HG changeset patch
130 > # HG changeset patch
131 > # User test
131 > # User test
132 > # Date 0 0
132 > # Date 0 0
133 > # Node ID 1c7a2f7cb77be1a0def34e4c7cabc562ad98fbd7
133 > # Node ID 1c7a2f7cb77be1a0def34e4c7cabc562ad98fbd7
134 > # Parent 0000000000000000000000000000000000000000
134 > # Parent 0000000000000000000000000000000000000000
135 > 1
135 > 1
136 >
136 >
137 > diff --git a/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-123456789-12.3456789-12345-ABCDEFGHIJKLMNOPRSTUVWXYZ-abcdefghjiklmnopqrstuvwxyz b/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-123456789-12.3456789-12345-ABCDEFGHIJKLMNOPRSTUVWXYZ-abcdefghjiklmnopqrstuvwxyz
137 > diff --git a/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-123456789-12.3456789-12345-ABCDEFGHIJKLMNOPRSTUVWXYZ-abcdefghjiklmnopqrstuvwxyz b/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-123456789-12.3456789-12345-ABCDEFGHIJKLMNOPRSTUVWXYZ-abcdefghjiklmnopqrstuvwxyz
138 > new file mode 100644
138 > new file mode 100644
139 > --- /dev/null
139 > --- /dev/null
140 > +++ b/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-123456789-12.3456789-12345-ABCDEFGHIJKLMNOPRSTUVWXYZ-abcdefghjiklmnopqrstuvwxyz
140 > +++ b/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-123456789-12.3456789-12345-ABCDEFGHIJKLMNOPRSTUVWXYZ-abcdefghjiklmnopqrstuvwxyz
141 > @@ -0,0 +1,1 @@
141 > @@ -0,0 +1,1 @@
142 > +foo
142 > +foo
143 > diff --git a/AUX/SECOND/X.PRN/FOURTH/FI:FTH/SIXTH/SEVENTH/EIGHTH/NINETH/TENTH/ELEVENTH/LOREMIPSUM.TXT b/AUX/SECOND/X.PRN/FOURTH/FI:FTH/SIXTH/SEVENTH/EIGHTH/NINETH/TENTH/ELEVENTH/LOREMIPSUM.TXT
143 > diff --git a/AUX/SECOND/X.PRN/FOURTH/FI:FTH/SIXTH/SEVENTH/EIGHTH/NINETH/TENTH/ELEVENTH/LOREMIPSUM.TXT b/AUX/SECOND/X.PRN/FOURTH/FI:FTH/SIXTH/SEVENTH/EIGHTH/NINETH/TENTH/ELEVENTH/LOREMIPSUM.TXT
144 > new file mode 100644
144 > new file mode 100644
145 > --- /dev/null
145 > --- /dev/null
146 > +++ b/AUX/SECOND/X.PRN/FOURTH/FI:FTH/SIXTH/SEVENTH/EIGHTH/NINETH/TENTH/ELEVENTH/LOREMIPSUM.TXT
146 > +++ b/AUX/SECOND/X.PRN/FOURTH/FI:FTH/SIXTH/SEVENTH/EIGHTH/NINETH/TENTH/ELEVENTH/LOREMIPSUM.TXT
147 > @@ -0,0 +1,1 @@
147 > @@ -0,0 +1,1 @@
148 > +foo
148 > +foo
149 > diff --git a/Project Planning/Resources/AnotherLongDirectoryName/Followedbyanother/AndAnother/AndThenAnExtremelyLongFileName.txt b/Project Planning/Resources/AnotherLongDirectoryName/Followedbyanother/AndAnother/AndThenAnExtremelyLongFileName.txt
149 > diff --git a/Project Planning/Resources/AnotherLongDirectoryName/Followedbyanother/AndAnother/AndThenAnExtremelyLongFileName.txt b/Project Planning/Resources/AnotherLongDirectoryName/Followedbyanother/AndAnother/AndThenAnExtremelyLongFileName.txt
150 > new file mode 100644
150 > new file mode 100644
151 > --- /dev/null
151 > --- /dev/null
152 > +++ b/Project Planning/Resources/AnotherLongDirectoryName/Followedbyanother/AndAnother/AndThenAnExtremelyLongFileName.txt
152 > +++ b/Project Planning/Resources/AnotherLongDirectoryName/Followedbyanother/AndAnother/AndThenAnExtremelyLongFileName.txt
153 > @@ -0,0 +1,1 @@
153 > @@ -0,0 +1,1 @@
154 > +foo
154 > +foo
155 > diff --git a/bla.aux/prn/PRN/lpt/com3/nul/coma/foo.NUL/normal.c b/bla.aux/prn/PRN/lpt/com3/nul/coma/foo.NUL/normal.c
155 > diff --git a/bla.aux/prn/PRN/lpt/com3/nul/coma/foo.NUL/normal.c b/bla.aux/prn/PRN/lpt/com3/nul/coma/foo.NUL/normal.c
156 > new file mode 100644
156 > new file mode 100644
157 > --- /dev/null
157 > --- /dev/null
158 > +++ b/bla.aux/prn/PRN/lpt/com3/nul/coma/foo.NUL/normal.c
158 > +++ b/bla.aux/prn/PRN/lpt/com3/nul/coma/foo.NUL/normal.c
159 > @@ -0,0 +1,1 @@
159 > @@ -0,0 +1,1 @@
160 > +foo
160 > +foo
161 > diff --git a/enterprise/openesbaddons/contrib-imola/corba-bc/netbeansplugin/wsdlExtension/src/main/java/META-INF/services/org.netbeans.modules.xml.wsdl.bindingsupport.spi.ExtensibilityElementTemplateProvider b/enterprise/openesbaddons/contrib-imola/corba-bc/netbeansplugin/wsdlExtension/src/main/java/META-INF/services/org.netbeans.modules.xml.wsdl.bindingsupport.spi.ExtensibilityElementTemplateProvider
161 > diff --git a/enterprise/openesbaddons/contrib-imola/corba-bc/netbeansplugin/wsdlExtension/src/main/java/META-INF/services/org.netbeans.modules.xml.wsdl.bindingsupport.spi.ExtensibilityElementTemplateProvider b/enterprise/openesbaddons/contrib-imola/corba-bc/netbeansplugin/wsdlExtension/src/main/java/META-INF/services/org.netbeans.modules.xml.wsdl.bindingsupport.spi.ExtensibilityElementTemplateProvider
162 > new file mode 100644
162 > new file mode 100644
163 > --- /dev/null
163 > --- /dev/null
164 > +++ b/enterprise/openesbaddons/contrib-imola/corba-bc/netbeansplugin/wsdlExtension/src/main/java/META-INF/services/org.netbeans.modules.xml.wsdl.bindingsupport.spi.ExtensibilityElementTemplateProvider
164 > +++ b/enterprise/openesbaddons/contrib-imola/corba-bc/netbeansplugin/wsdlExtension/src/main/java/META-INF/services/org.netbeans.modules.xml.wsdl.bindingsupport.spi.ExtensibilityElementTemplateProvider
165 > @@ -0,0 +1,1 @@
165 > @@ -0,0 +1,1 @@
166 > +foo
166 > +foo
167 > EOF
167 > EOF
168
168
169 $ find .hg/store -name *.i | sort
169 $ find .hg/store -name *.i | sort
170 .hg/store/00changelog.i
170 .hg/store/00changelog.i
171 .hg/store/00manifest.i
171 .hg/store/00manifest.i
172 .hg/store/data/bla.aux/pr~6e/_p_r_n/lpt/co~6d3/nu~6c/coma/foo._n_u_l/normal.c.i
172 .hg/store/data/bla.aux/pr~6e/_p_r_n/lpt/co~6d3/nu~6c/coma/foo._n_u_l/normal.c.i
173 .hg/store/dh/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/xxxxxx168e07b38e65eff86ab579afaaa8e30bfbe0f35f.i
173 .hg/store/dh/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/xxxxxx168e07b38e65eff86ab579afaaa8e30bfbe0f35f.i
174 .hg/store/dh/au~78/second/x.prn/fourth/fi~3afth/sixth/seventh/eighth/nineth/tenth/loremia20419e358ddff1bf8751e38288aff1d7c32ec05.i
174 .hg/store/dh/au~78/second/x.prn/fourth/fi~3afth/sixth/seventh/eighth/nineth/tenth/loremia20419e358ddff1bf8751e38288aff1d7c32ec05.i
175 .hg/store/dh/enterpri/openesba/contrib-/corba-bc/netbeans/wsdlexte/src/main/java/org.net7018f27961fdf338a598a40c4683429e7ffb9743.i
175 .hg/store/dh/enterpri/openesba/contrib-/corba-bc/netbeans/wsdlexte/src/main/java/org.net7018f27961fdf338a598a40c4683429e7ffb9743.i
176 .hg/store/dh/project_/resource/anotherl/followed/andanoth/andthenanextremelylongfilename0d8e1f4187c650e2f1fdca9fd90f786bc0976b6b.i
176 .hg/store/dh/project_/resource/anotherl/followed/andanoth/andthenanextremelylongfilename0d8e1f4187c650e2f1fdca9fd90f786bc0976b6b.i
177
177
178 $ cd ..
178 $ cd ..
179
179
180
180
@@ -1,350 +1,350 b''
1 $ "$TESTDIR/hghave" hardlink || exit 80
1 $ "$TESTDIR/hghave" hardlink || exit 80
2
2
3 $ cat > nlinks.py <<EOF
3 $ cat > nlinks.py <<EOF
4 > import sys
4 > import sys
5 > from mercurial import util
5 > from mercurial import util
6 > for f in sorted(sys.stdin.readlines()):
6 > for f in sorted(sys.stdin.readlines()):
7 > f = f[:-1]
7 > f = f[:-1]
8 > print util.nlinks(f), f
8 > print util.nlinks(f), f
9 > EOF
9 > EOF
10
10
11 $ nlinksdir()
11 $ nlinksdir()
12 > {
12 > {
13 > find $1 -type f | python $TESTTMP/nlinks.py
13 > find $1 -type f | python $TESTTMP/nlinks.py
14 > }
14 > }
15
15
16 Some implementations of cp can't create hardlinks (replaces 'cp -al' on Linux):
16 Some implementations of cp can't create hardlinks (replaces 'cp -al' on Linux):
17
17
18 $ cat > linkcp.py <<EOF
18 $ cat > linkcp.py <<EOF
19 > from mercurial import util
19 > from mercurial import util
20 > import sys
20 > import sys
21 > util.copyfiles(sys.argv[1], sys.argv[2], hardlink=True)
21 > util.copyfiles(sys.argv[1], sys.argv[2], hardlink=True)
22 > EOF
22 > EOF
23
23
24 $ linkcp()
24 $ linkcp()
25 > {
25 > {
26 > python $TESTTMP/linkcp.py $1 $2
26 > python $TESTTMP/linkcp.py $1 $2
27 > }
27 > }
28
28
29 Prepare repo r1:
29 Prepare repo r1:
30
30
31 $ hg init r1
31 $ hg init r1
32 $ cd r1
32 $ cd r1
33
33
34 $ echo c1 > f1
34 $ echo c1 > f1
35 $ hg add f1
35 $ hg add f1
36 $ hg ci -m0
36 $ hg ci -m0
37
37
38 $ mkdir d1
38 $ mkdir d1
39 $ cd d1
39 $ cd d1
40 $ echo c2 > f2
40 $ echo c2 > f2
41 $ hg add f2
41 $ hg add f2
42 $ hg ci -m1
42 $ hg ci -m1
43 $ cd ../..
43 $ cd ../..
44
44
45 $ nlinksdir r1/.hg/store
45 $ nlinksdir r1/.hg/store
46 1 r1/.hg/store/00changelog.i
46 1 r1/.hg/store/00changelog.i
47 1 r1/.hg/store/00manifest.i
47 1 r1/.hg/store/00manifest.i
48 1 r1/.hg/store/data/d1/f2.i
48 1 r1/.hg/store/data/d1/f2.i
49 1 r1/.hg/store/data/f1.i
49 1 r1/.hg/store/data/f1.i
50 1 r1/.hg/store/fncache
50 1 r1/.hg/store/fncache
51 1 r1/.hg/store/phaseroots
51 1 r1/.hg/store/phaseroots
52 1 r1/.hg/store/undo
52 1 r1/.hg/store/undo
53 1 r1/.hg/store/undo.phaseroots
53 1 r1/.hg/store/undo.phaseroots
54
54
55
55
56 Create hardlinked clone r2:
56 Create hardlinked clone r2:
57
57
58 $ hg clone -U --debug r1 r2
58 $ hg clone -U --debug r1 r2
59 linked 7 files
59 linked 7 files
60 listing keys for "bookmarks"
60 listing keys for "bookmarks"
61
61
62 Create non-hardlinked clone r3:
62 Create non-hardlinked clone r3:
63
63
64 $ hg clone --pull r1 r3
64 $ hg clone --pull r1 r3
65 requesting all changes
65 requesting all changes
66 adding changesets
66 adding changesets
67 adding manifests
67 adding manifests
68 adding file changes
68 adding file changes
69 added 2 changesets with 2 changes to 2 files
69 added 2 changesets with 2 changes to 2 files
70 updating to branch default
70 updating to branch default
71 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
71 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
72
72
73
73
74 Repos r1 and r2 should now contain hardlinked files:
74 Repos r1 and r2 should now contain hardlinked files:
75
75
76 $ nlinksdir r1/.hg/store
76 $ nlinksdir r1/.hg/store
77 2 r1/.hg/store/00changelog.i
77 2 r1/.hg/store/00changelog.i
78 2 r1/.hg/store/00manifest.i
78 2 r1/.hg/store/00manifest.i
79 2 r1/.hg/store/data/d1/f2.i
79 2 r1/.hg/store/data/d1/f2.i
80 2 r1/.hg/store/data/f1.i
80 2 r1/.hg/store/data/f1.i
81 2 r1/.hg/store/fncache
81 2 r1/.hg/store/fncache
82 1 r1/.hg/store/phaseroots
82 1 r1/.hg/store/phaseroots
83 1 r1/.hg/store/undo
83 1 r1/.hg/store/undo
84 1 r1/.hg/store/undo.phaseroots
84 1 r1/.hg/store/undo.phaseroots
85
85
86 $ nlinksdir r2/.hg/store
86 $ nlinksdir r2/.hg/store
87 2 r2/.hg/store/00changelog.i
87 2 r2/.hg/store/00changelog.i
88 2 r2/.hg/store/00manifest.i
88 2 r2/.hg/store/00manifest.i
89 2 r2/.hg/store/data/d1/f2.i
89 2 r2/.hg/store/data/d1/f2.i
90 2 r2/.hg/store/data/f1.i
90 2 r2/.hg/store/data/f1.i
91 2 r2/.hg/store/fncache
91 2 r2/.hg/store/fncache
92
92
93 Repo r3 should not be hardlinked:
93 Repo r3 should not be hardlinked:
94
94
95 $ nlinksdir r3/.hg/store
95 $ nlinksdir r3/.hg/store
96 1 r3/.hg/store/00changelog.i
96 1 r3/.hg/store/00changelog.i
97 1 r3/.hg/store/00manifest.i
97 1 r3/.hg/store/00manifest.i
98 1 r3/.hg/store/data/d1/f2.i
98 1 r3/.hg/store/data/d1/f2.i
99 1 r3/.hg/store/data/f1.i
99 1 r3/.hg/store/data/f1.i
100 1 r3/.hg/store/fncache
100 1 r3/.hg/store/fncache
101 1 r3/.hg/store/phaseroots
101 1 r3/.hg/store/phaseroots
102 1 r3/.hg/store/undo
102 1 r3/.hg/store/undo
103 1 r3/.hg/store/undo.phaseroots
103 1 r3/.hg/store/undo.phaseroots
104
104
105
105
106 Create a non-inlined filelog in r3:
106 Create a non-inlined filelog in r3:
107
107
108 $ cd r3/d1
108 $ cd r3/d1
109 >>> f = open('data1', 'wb')
109 >>> f = open('data1', 'wb')
110 >>> for x in range(10000):
110 >>> for x in range(10000):
111 ... f.write("%s\n" % str(x))
111 ... f.write("%s\n" % str(x))
112 >>> f.close()
112 >>> f.close()
113 $ for j in 0 1 2 3 4 5 6 7 8 9; do
113 $ for j in 0 1 2 3 4 5 6 7 8 9; do
114 > cat data1 >> f2
114 > cat data1 >> f2
115 > hg commit -m$j
115 > hg commit -m$j
116 > done
116 > done
117 $ cd ../..
117 $ cd ../..
118
118
119 $ nlinksdir r3/.hg/store
119 $ nlinksdir r3/.hg/store
120 1 r3/.hg/store/00changelog.i
120 1 r3/.hg/store/00changelog.i
121 1 r3/.hg/store/00manifest.i
121 1 r3/.hg/store/00manifest.i
122 1 r3/.hg/store/data/d1/f2.d
122 1 r3/.hg/store/data/d1/f2.d
123 1 r3/.hg/store/data/d1/f2.i
123 1 r3/.hg/store/data/d1/f2.i
124 1 r3/.hg/store/data/f1.i
124 1 r3/.hg/store/data/f1.i
125 1 r3/.hg/store/fncache
125 1 r3/.hg/store/fncache
126 1 r3/.hg/store/phaseroots
126 1 r3/.hg/store/phaseroots
127 1 r3/.hg/store/undo
127 1 r3/.hg/store/undo
128 1 r3/.hg/store/undo.phaseroots
128 1 r3/.hg/store/undo.phaseroots
129
129
130 Push to repo r1 should break up most hardlinks in r2:
130 Push to repo r1 should break up most hardlinks in r2:
131
131
132 $ hg -R r2 verify
132 $ hg -R r2 verify
133 checking changesets
133 checking changesets
134 checking manifests
134 checking manifests
135 crosschecking files in changesets and manifests
135 crosschecking files in changesets and manifests
136 checking files
136 checking files
137 2 files, 2 changesets, 2 total revisions
137 2 files, 2 changesets, 2 total revisions
138
138
139 $ cd r3
139 $ cd r3
140 $ hg push
140 $ hg push
141 pushing to $TESTTMP/r1 (glob)
141 pushing to $TESTTMP/r1 (glob)
142 searching for changes
142 searching for changes
143 adding changesets
143 adding changesets
144 adding manifests
144 adding manifests
145 adding file changes
145 adding file changes
146 added 10 changesets with 10 changes to 1 files
146 added 10 changesets with 10 changes to 1 files
147
147
148 $ cd ..
148 $ cd ..
149
149
150 $ nlinksdir r2/.hg/store
150 $ nlinksdir r2/.hg/store
151 1 r2/.hg/store/00changelog.i
151 1 r2/.hg/store/00changelog.i
152 1 r2/.hg/store/00manifest.i
152 1 r2/.hg/store/00manifest.i
153 1 r2/.hg/store/data/d1/f2.i
153 1 r2/.hg/store/data/d1/f2.i
154 2 r2/.hg/store/data/f1.i
154 2 r2/.hg/store/data/f1.i
155 1 r2/.hg/store/fncache
155 1 r2/.hg/store/fncache
156
156
157 $ hg -R r2 verify
157 $ hg -R r2 verify
158 checking changesets
158 checking changesets
159 checking manifests
159 checking manifests
160 crosschecking files in changesets and manifests
160 crosschecking files in changesets and manifests
161 checking files
161 checking files
162 2 files, 2 changesets, 2 total revisions
162 2 files, 2 changesets, 2 total revisions
163
163
164
164
165 $ cd r1
165 $ cd r1
166 $ hg up
166 $ hg up
167 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
167 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
168
168
169 Committing a change to f1 in r1 must break up hardlink f1.i in r2:
169 Committing a change to f1 in r1 must break up hardlink f1.i in r2:
170
170
171 $ echo c1c1 >> f1
171 $ echo c1c1 >> f1
172 $ hg ci -m00
172 $ hg ci -m00
173 $ cd ..
173 $ cd ..
174
174
175 $ nlinksdir r2/.hg/store
175 $ nlinksdir r2/.hg/store
176 1 r2/.hg/store/00changelog.i
176 1 r2/.hg/store/00changelog.i
177 1 r2/.hg/store/00manifest.i
177 1 r2/.hg/store/00manifest.i
178 1 r2/.hg/store/data/d1/f2.i
178 1 r2/.hg/store/data/d1/f2.i
179 1 r2/.hg/store/data/f1.i
179 1 r2/.hg/store/data/f1.i
180 1 r2/.hg/store/fncache
180 1 r2/.hg/store/fncache
181
181
182
182
183 $ cd r3
183 $ cd r3
184 $ hg tip --template '{rev}:{node|short}\n'
184 $ hg tip --template '{rev}:{node|short}\n'
185 11:a6451b6bc41f
185 11:a6451b6bc41f
186 $ echo bla > f1
186 $ echo bla > f1
187 $ hg ci -m1
187 $ hg ci -m1
188 $ cd ..
188 $ cd ..
189
189
190 Create hardlinked copy r4 of r3 (on Linux, we would call 'cp -al'):
190 Create hardlinked copy r4 of r3 (on Linux, we would call 'cp -al'):
191
191
192 $ linkcp r3 r4
192 $ linkcp r3 r4
193
193
194 r4 has hardlinks in the working dir (not just inside .hg):
194 r4 has hardlinks in the working dir (not just inside .hg):
195
195
196 $ nlinksdir r4
196 $ nlinksdir r4
197 2 r4/.hg/00changelog.i
197 2 r4/.hg/00changelog.i
198 2 r4/.hg/branch
198 2 r4/.hg/branch
199 2 r4/.hg/cache/branchheads
199 2 r4/.hg/cache/branchheads-unserved
200 2 r4/.hg/dirstate
200 2 r4/.hg/dirstate
201 2 r4/.hg/hgrc
201 2 r4/.hg/hgrc
202 2 r4/.hg/last-message.txt
202 2 r4/.hg/last-message.txt
203 2 r4/.hg/requires
203 2 r4/.hg/requires
204 2 r4/.hg/store/00changelog.i
204 2 r4/.hg/store/00changelog.i
205 2 r4/.hg/store/00manifest.i
205 2 r4/.hg/store/00manifest.i
206 2 r4/.hg/store/data/d1/f2.d
206 2 r4/.hg/store/data/d1/f2.d
207 2 r4/.hg/store/data/d1/f2.i
207 2 r4/.hg/store/data/d1/f2.i
208 2 r4/.hg/store/data/f1.i
208 2 r4/.hg/store/data/f1.i
209 2 r4/.hg/store/fncache
209 2 r4/.hg/store/fncache
210 2 r4/.hg/store/phaseroots
210 2 r4/.hg/store/phaseroots
211 2 r4/.hg/store/undo
211 2 r4/.hg/store/undo
212 2 r4/.hg/store/undo.phaseroots
212 2 r4/.hg/store/undo.phaseroots
213 2 r4/.hg/undo.bookmarks
213 2 r4/.hg/undo.bookmarks
214 2 r4/.hg/undo.branch
214 2 r4/.hg/undo.branch
215 2 r4/.hg/undo.desc
215 2 r4/.hg/undo.desc
216 2 r4/.hg/undo.dirstate
216 2 r4/.hg/undo.dirstate
217 2 r4/d1/data1
217 2 r4/d1/data1
218 2 r4/d1/f2
218 2 r4/d1/f2
219 2 r4/f1
219 2 r4/f1
220
220
221 Update back to revision 11 in r4 should break hardlink of file f1:
221 Update back to revision 11 in r4 should break hardlink of file f1:
222
222
223 $ hg -R r4 up 11
223 $ hg -R r4 up 11
224 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
224 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
225
225
226 $ nlinksdir r4
226 $ nlinksdir r4
227 2 r4/.hg/00changelog.i
227 2 r4/.hg/00changelog.i
228 1 r4/.hg/branch
228 1 r4/.hg/branch
229 2 r4/.hg/cache/branchheads
229 2 r4/.hg/cache/branchheads-unserved
230 1 r4/.hg/dirstate
230 1 r4/.hg/dirstate
231 2 r4/.hg/hgrc
231 2 r4/.hg/hgrc
232 2 r4/.hg/last-message.txt
232 2 r4/.hg/last-message.txt
233 2 r4/.hg/requires
233 2 r4/.hg/requires
234 2 r4/.hg/store/00changelog.i
234 2 r4/.hg/store/00changelog.i
235 2 r4/.hg/store/00manifest.i
235 2 r4/.hg/store/00manifest.i
236 2 r4/.hg/store/data/d1/f2.d
236 2 r4/.hg/store/data/d1/f2.d
237 2 r4/.hg/store/data/d1/f2.i
237 2 r4/.hg/store/data/d1/f2.i
238 2 r4/.hg/store/data/f1.i
238 2 r4/.hg/store/data/f1.i
239 2 r4/.hg/store/fncache
239 2 r4/.hg/store/fncache
240 2 r4/.hg/store/phaseroots
240 2 r4/.hg/store/phaseroots
241 2 r4/.hg/store/undo
241 2 r4/.hg/store/undo
242 2 r4/.hg/store/undo.phaseroots
242 2 r4/.hg/store/undo.phaseroots
243 2 r4/.hg/undo.bookmarks
243 2 r4/.hg/undo.bookmarks
244 2 r4/.hg/undo.branch
244 2 r4/.hg/undo.branch
245 2 r4/.hg/undo.desc
245 2 r4/.hg/undo.desc
246 2 r4/.hg/undo.dirstate
246 2 r4/.hg/undo.dirstate
247 2 r4/d1/data1
247 2 r4/d1/data1
248 2 r4/d1/f2
248 2 r4/d1/f2
249 1 r4/f1
249 1 r4/f1
250
250
251
251
252 Test hardlinking outside hg:
252 Test hardlinking outside hg:
253
253
254 $ mkdir x
254 $ mkdir x
255 $ echo foo > x/a
255 $ echo foo > x/a
256
256
257 $ linkcp x y
257 $ linkcp x y
258 $ echo bar >> y/a
258 $ echo bar >> y/a
259
259
260 No diff if hardlink:
260 No diff if hardlink:
261
261
262 $ diff x/a y/a
262 $ diff x/a y/a
263
263
264 Test mq hardlinking:
264 Test mq hardlinking:
265
265
266 $ echo "[extensions]" >> $HGRCPATH
266 $ echo "[extensions]" >> $HGRCPATH
267 $ echo "mq=" >> $HGRCPATH
267 $ echo "mq=" >> $HGRCPATH
268
268
269 $ hg init a
269 $ hg init a
270 $ cd a
270 $ cd a
271
271
272 $ hg qimport -n foo - << EOF
272 $ hg qimport -n foo - << EOF
273 > # HG changeset patch
273 > # HG changeset patch
274 > # Date 1 0
274 > # Date 1 0
275 > diff -r 2588a8b53d66 a
275 > diff -r 2588a8b53d66 a
276 > --- /dev/null Thu Jan 01 00:00:00 1970 +0000
276 > --- /dev/null Thu Jan 01 00:00:00 1970 +0000
277 > +++ b/a Wed Jul 23 15:54:29 2008 +0200
277 > +++ b/a Wed Jul 23 15:54:29 2008 +0200
278 > @@ -0,0 +1,1 @@
278 > @@ -0,0 +1,1 @@
279 > +a
279 > +a
280 > EOF
280 > EOF
281 adding foo to series file
281 adding foo to series file
282
282
283 $ hg qpush
283 $ hg qpush
284 applying foo
284 applying foo
285 now at: foo
285 now at: foo
286
286
287 $ cd ..
287 $ cd ..
288 $ linkcp a b
288 $ linkcp a b
289 $ cd b
289 $ cd b
290
290
291 $ hg qimport -n bar - << EOF
291 $ hg qimport -n bar - << EOF
292 > # HG changeset patch
292 > # HG changeset patch
293 > # Date 2 0
293 > # Date 2 0
294 > diff -r 2588a8b53d66 a
294 > diff -r 2588a8b53d66 a
295 > --- /dev/null Thu Jan 01 00:00:00 1970 +0000
295 > --- /dev/null Thu Jan 01 00:00:00 1970 +0000
296 > +++ b/b Wed Jul 23 15:54:29 2008 +0200
296 > +++ b/b Wed Jul 23 15:54:29 2008 +0200
297 > @@ -0,0 +1,1 @@
297 > @@ -0,0 +1,1 @@
298 > +b
298 > +b
299 > EOF
299 > EOF
300 adding bar to series file
300 adding bar to series file
301
301
302 $ hg qpush
302 $ hg qpush
303 applying bar
303 applying bar
304 now at: bar
304 now at: bar
305
305
306 $ cat .hg/patches/status
306 $ cat .hg/patches/status
307 430ed4828a74fa4047bc816a25500f7472ab4bfe:foo
307 430ed4828a74fa4047bc816a25500f7472ab4bfe:foo
308 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c:bar
308 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c:bar
309
309
310 $ cat .hg/patches/series
310 $ cat .hg/patches/series
311 foo
311 foo
312 bar
312 bar
313
313
314 $ cat ../a/.hg/patches/status
314 $ cat ../a/.hg/patches/status
315 430ed4828a74fa4047bc816a25500f7472ab4bfe:foo
315 430ed4828a74fa4047bc816a25500f7472ab4bfe:foo
316
316
317 $ cat ../a/.hg/patches/series
317 $ cat ../a/.hg/patches/series
318 foo
318 foo
319
319
320 Test tags hardlinking:
320 Test tags hardlinking:
321
321
322 $ hg qdel -r qbase:qtip
322 $ hg qdel -r qbase:qtip
323 patch foo finalized without changeset message
323 patch foo finalized without changeset message
324 patch bar finalized without changeset message
324 patch bar finalized without changeset message
325
325
326 $ hg tag -l lfoo
326 $ hg tag -l lfoo
327 $ hg tag foo
327 $ hg tag foo
328
328
329 $ cd ..
329 $ cd ..
330 $ linkcp b c
330 $ linkcp b c
331 $ cd c
331 $ cd c
332
332
333 $ hg tag -l -r 0 lbar
333 $ hg tag -l -r 0 lbar
334 $ hg tag -r 0 bar
334 $ hg tag -r 0 bar
335
335
336 $ cat .hgtags
336 $ cat .hgtags
337 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c foo
337 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c foo
338 430ed4828a74fa4047bc816a25500f7472ab4bfe bar
338 430ed4828a74fa4047bc816a25500f7472ab4bfe bar
339
339
340 $ cat .hg/localtags
340 $ cat .hg/localtags
341 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c lfoo
341 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c lfoo
342 430ed4828a74fa4047bc816a25500f7472ab4bfe lbar
342 430ed4828a74fa4047bc816a25500f7472ab4bfe lbar
343
343
344 $ cat ../b/.hgtags
344 $ cat ../b/.hgtags
345 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c foo
345 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c foo
346
346
347 $ cat ../b/.hg/localtags
347 $ cat ../b/.hg/localtags
348 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c lfoo
348 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c lfoo
349
349
350 $ cd ..
350 $ cd ..
@@ -1,152 +1,152 b''
1 test that new files created in .hg inherit the permissions from .hg/store
1 test that new files created in .hg inherit the permissions from .hg/store
2
2
3
3
4 $ "$TESTDIR/hghave" unix-permissions || exit 80
4 $ "$TESTDIR/hghave" unix-permissions || exit 80
5
5
6 $ mkdir dir
6 $ mkdir dir
7
7
8 just in case somebody has a strange $TMPDIR
8 just in case somebody has a strange $TMPDIR
9
9
10 $ chmod g-s dir
10 $ chmod g-s dir
11 $ cd dir
11 $ cd dir
12
12
13 $ cat >printmodes.py <<EOF
13 $ cat >printmodes.py <<EOF
14 > import os, sys
14 > import os, sys
15 >
15 >
16 > allnames = []
16 > allnames = []
17 > isdir = {}
17 > isdir = {}
18 > for root, dirs, files in os.walk(sys.argv[1]):
18 > for root, dirs, files in os.walk(sys.argv[1]):
19 > for d in dirs:
19 > for d in dirs:
20 > name = os.path.join(root, d)
20 > name = os.path.join(root, d)
21 > isdir[name] = 1
21 > isdir[name] = 1
22 > allnames.append(name)
22 > allnames.append(name)
23 > for f in files:
23 > for f in files:
24 > name = os.path.join(root, f)
24 > name = os.path.join(root, f)
25 > allnames.append(name)
25 > allnames.append(name)
26 > allnames.sort()
26 > allnames.sort()
27 > for name in allnames:
27 > for name in allnames:
28 > suffix = name in isdir and '/' or ''
28 > suffix = name in isdir and '/' or ''
29 > print '%05o %s%s' % (os.lstat(name).st_mode & 07777, name, suffix)
29 > print '%05o %s%s' % (os.lstat(name).st_mode & 07777, name, suffix)
30 > EOF
30 > EOF
31
31
32 $ cat >mode.py <<EOF
32 $ cat >mode.py <<EOF
33 > import sys
33 > import sys
34 > import os
34 > import os
35 > print '%05o' % os.lstat(sys.argv[1]).st_mode
35 > print '%05o' % os.lstat(sys.argv[1]).st_mode
36 > EOF
36 > EOF
37
37
38 $ umask 077
38 $ umask 077
39
39
40 $ hg init repo
40 $ hg init repo
41 $ cd repo
41 $ cd repo
42
42
43 $ chmod 0770 .hg/store
43 $ chmod 0770 .hg/store
44
44
45 before commit
45 before commit
46 store can be written by the group, other files cannot
46 store can be written by the group, other files cannot
47 store is setgid
47 store is setgid
48
48
49 $ python ../printmodes.py .
49 $ python ../printmodes.py .
50 00700 ./.hg/
50 00700 ./.hg/
51 00600 ./.hg/00changelog.i
51 00600 ./.hg/00changelog.i
52 00600 ./.hg/requires
52 00600 ./.hg/requires
53 00770 ./.hg/store/
53 00770 ./.hg/store/
54
54
55 $ mkdir dir
55 $ mkdir dir
56 $ touch foo dir/bar
56 $ touch foo dir/bar
57 $ hg ci -qAm 'add files'
57 $ hg ci -qAm 'add files'
58
58
59 after commit
59 after commit
60 working dir files can only be written by the owner
60 working dir files can only be written by the owner
61 files created in .hg can be written by the group
61 files created in .hg can be written by the group
62 (in particular, store/**, dirstate, branch cache file, undo files)
62 (in particular, store/**, dirstate, branch cache file, undo files)
63 new directories are setgid
63 new directories are setgid
64
64
65 $ python ../printmodes.py .
65 $ python ../printmodes.py .
66 00700 ./.hg/
66 00700 ./.hg/
67 00600 ./.hg/00changelog.i
67 00600 ./.hg/00changelog.i
68 00770 ./.hg/cache/
68 00770 ./.hg/cache/
69 00660 ./.hg/cache/branchheads
69 00660 ./.hg/cache/branchheads-unserved
70 00660 ./.hg/dirstate
70 00660 ./.hg/dirstate
71 00660 ./.hg/last-message.txt
71 00660 ./.hg/last-message.txt
72 00600 ./.hg/requires
72 00600 ./.hg/requires
73 00770 ./.hg/store/
73 00770 ./.hg/store/
74 00660 ./.hg/store/00changelog.i
74 00660 ./.hg/store/00changelog.i
75 00660 ./.hg/store/00manifest.i
75 00660 ./.hg/store/00manifest.i
76 00770 ./.hg/store/data/
76 00770 ./.hg/store/data/
77 00770 ./.hg/store/data/dir/
77 00770 ./.hg/store/data/dir/
78 00660 ./.hg/store/data/dir/bar.i
78 00660 ./.hg/store/data/dir/bar.i
79 00660 ./.hg/store/data/foo.i
79 00660 ./.hg/store/data/foo.i
80 00660 ./.hg/store/fncache
80 00660 ./.hg/store/fncache
81 00660 ./.hg/store/phaseroots
81 00660 ./.hg/store/phaseroots
82 00660 ./.hg/store/undo
82 00660 ./.hg/store/undo
83 00660 ./.hg/store/undo.phaseroots
83 00660 ./.hg/store/undo.phaseroots
84 00660 ./.hg/undo.bookmarks
84 00660 ./.hg/undo.bookmarks
85 00660 ./.hg/undo.branch
85 00660 ./.hg/undo.branch
86 00660 ./.hg/undo.desc
86 00660 ./.hg/undo.desc
87 00660 ./.hg/undo.dirstate
87 00660 ./.hg/undo.dirstate
88 00700 ./dir/
88 00700 ./dir/
89 00600 ./dir/bar
89 00600 ./dir/bar
90 00600 ./foo
90 00600 ./foo
91
91
92 $ umask 007
92 $ umask 007
93 $ hg init ../push
93 $ hg init ../push
94
94
95 before push
95 before push
96 group can write everything
96 group can write everything
97
97
98 $ python ../printmodes.py ../push
98 $ python ../printmodes.py ../push
99 00770 ../push/.hg/
99 00770 ../push/.hg/
100 00660 ../push/.hg/00changelog.i
100 00660 ../push/.hg/00changelog.i
101 00660 ../push/.hg/requires
101 00660 ../push/.hg/requires
102 00770 ../push/.hg/store/
102 00770 ../push/.hg/store/
103
103
104 $ umask 077
104 $ umask 077
105 $ hg -q push ../push
105 $ hg -q push ../push
106
106
107 after push
107 after push
108 group can still write everything
108 group can still write everything
109
109
110 $ python ../printmodes.py ../push
110 $ python ../printmodes.py ../push
111 00770 ../push/.hg/
111 00770 ../push/.hg/
112 00660 ../push/.hg/00changelog.i
112 00660 ../push/.hg/00changelog.i
113 00770 ../push/.hg/cache/
113 00770 ../push/.hg/cache/
114 00660 ../push/.hg/cache/branchheads
114 00660 ../push/.hg/cache/branchheads-unserved
115 00660 ../push/.hg/requires
115 00660 ../push/.hg/requires
116 00770 ../push/.hg/store/
116 00770 ../push/.hg/store/
117 00660 ../push/.hg/store/00changelog.i
117 00660 ../push/.hg/store/00changelog.i
118 00660 ../push/.hg/store/00manifest.i
118 00660 ../push/.hg/store/00manifest.i
119 00770 ../push/.hg/store/data/
119 00770 ../push/.hg/store/data/
120 00770 ../push/.hg/store/data/dir/
120 00770 ../push/.hg/store/data/dir/
121 00660 ../push/.hg/store/data/dir/bar.i
121 00660 ../push/.hg/store/data/dir/bar.i
122 00660 ../push/.hg/store/data/foo.i
122 00660 ../push/.hg/store/data/foo.i
123 00660 ../push/.hg/store/fncache
123 00660 ../push/.hg/store/fncache
124 00660 ../push/.hg/store/phaseroots
124 00660 ../push/.hg/store/phaseroots
125 00660 ../push/.hg/store/undo
125 00660 ../push/.hg/store/undo
126 00660 ../push/.hg/store/undo.phaseroots
126 00660 ../push/.hg/store/undo.phaseroots
127 00660 ../push/.hg/undo.bookmarks
127 00660 ../push/.hg/undo.bookmarks
128 00660 ../push/.hg/undo.branch
128 00660 ../push/.hg/undo.branch
129 00660 ../push/.hg/undo.desc
129 00660 ../push/.hg/undo.desc
130 00660 ../push/.hg/undo.dirstate
130 00660 ../push/.hg/undo.dirstate
131
131
132
132
133 Test that we don't lose the setgid bit when we call chmod.
133 Test that we don't lose the setgid bit when we call chmod.
134 Not all systems support setgid directories (e.g. HFS+), so
134 Not all systems support setgid directories (e.g. HFS+), so
135 just check that directories have the same mode.
135 just check that directories have the same mode.
136
136
137 $ cd ..
137 $ cd ..
138 $ hg init setgid
138 $ hg init setgid
139 $ cd setgid
139 $ cd setgid
140 $ chmod g+rwx .hg/store
140 $ chmod g+rwx .hg/store
141 $ chmod g+s .hg/store 2> /dev/null || true
141 $ chmod g+s .hg/store 2> /dev/null || true
142 $ mkdir dir
142 $ mkdir dir
143 $ touch dir/file
143 $ touch dir/file
144 $ hg ci -qAm 'add dir/file'
144 $ hg ci -qAm 'add dir/file'
145 $ storemode=`python ../mode.py .hg/store`
145 $ storemode=`python ../mode.py .hg/store`
146 $ dirmode=`python ../mode.py .hg/store/data/dir`
146 $ dirmode=`python ../mode.py .hg/store/data/dir`
147 $ if [ "$storemode" != "$dirmode" ]; then
147 $ if [ "$storemode" != "$dirmode" ]; then
148 > echo "$storemode != $dirmode"
148 > echo "$storemode != $dirmode"
149 > fi
149 > fi
150 $ cd ..
150 $ cd ..
151
151
152 $ cd .. # g-s dir
152 $ cd .. # g-s dir
@@ -1,1137 +1,1143 b''
1 $ cat <<EOF >> $HGRCPATH
1 $ cat <<EOF >> $HGRCPATH
2 > [extensions]
2 > [extensions]
3 > keyword =
3 > keyword =
4 > mq =
4 > mq =
5 > notify =
5 > notify =
6 > record =
6 > record =
7 > transplant =
7 > transplant =
8 > [ui]
8 > [ui]
9 > interactive = true
9 > interactive = true
10 > EOF
10 > EOF
11
11
12 hide outer repo
12 hide outer repo
13 $ hg init
13 $ hg init
14
14
15 Run kwdemo before [keyword] files are set up
15 Run kwdemo before [keyword] files are set up
16 as it would succeed without uisetup otherwise
16 as it would succeed without uisetup otherwise
17
17
18 $ hg --quiet kwdemo
18 $ hg --quiet kwdemo
19 [extensions]
19 [extensions]
20 keyword =
20 keyword =
21 [keyword]
21 [keyword]
22 demo.txt =
22 demo.txt =
23 [keywordset]
23 [keywordset]
24 svn = False
24 svn = False
25 [keywordmaps]
25 [keywordmaps]
26 Author = {author|user}
26 Author = {author|user}
27 Date = {date|utcdate}
27 Date = {date|utcdate}
28 Header = {root}/{file},v {node|short} {date|utcdate} {author|user}
28 Header = {root}/{file},v {node|short} {date|utcdate} {author|user}
29 Id = {file|basename},v {node|short} {date|utcdate} {author|user}
29 Id = {file|basename},v {node|short} {date|utcdate} {author|user}
30 RCSFile = {file|basename},v
30 RCSFile = {file|basename},v
31 RCSfile = {file|basename},v
31 RCSfile = {file|basename},v
32 Revision = {node|short}
32 Revision = {node|short}
33 Source = {root}/{file},v
33 Source = {root}/{file},v
34 $Author: test $
34 $Author: test $
35 $Date: ????/??/?? ??:??:?? $ (glob)
35 $Date: ????/??/?? ??:??:?? $ (glob)
36 $Header: */demo.txt,v ???????????? ????/??/?? ??:??:?? test $ (glob)
36 $Header: */demo.txt,v ???????????? ????/??/?? ??:??:?? test $ (glob)
37 $Id: demo.txt,v ???????????? ????/??/?? ??:??:?? test $ (glob)
37 $Id: demo.txt,v ???????????? ????/??/?? ??:??:?? test $ (glob)
38 $RCSFile: demo.txt,v $
38 $RCSFile: demo.txt,v $
39 $RCSfile: demo.txt,v $
39 $RCSfile: demo.txt,v $
40 $Revision: ???????????? $ (glob)
40 $Revision: ???????????? $ (glob)
41 $Source: */demo.txt,v $ (glob)
41 $Source: */demo.txt,v $ (glob)
42
42
43 $ hg --quiet kwdemo "Branch = {branches}"
43 $ hg --quiet kwdemo "Branch = {branches}"
44 [extensions]
44 [extensions]
45 keyword =
45 keyword =
46 [keyword]
46 [keyword]
47 demo.txt =
47 demo.txt =
48 [keywordset]
48 [keywordset]
49 svn = False
49 svn = False
50 [keywordmaps]
50 [keywordmaps]
51 Branch = {branches}
51 Branch = {branches}
52 $Branch: demobranch $
52 $Branch: demobranch $
53
53
54 $ cat <<EOF >> $HGRCPATH
54 $ cat <<EOF >> $HGRCPATH
55 > [keyword]
55 > [keyword]
56 > ** =
56 > ** =
57 > b = ignore
57 > b = ignore
58 > i = ignore
58 > i = ignore
59 > [hooks]
59 > [hooks]
60 > EOF
60 > EOF
61 $ cp $HGRCPATH $HGRCPATH.nohooks
61 $ cp $HGRCPATH $HGRCPATH.nohooks
62 > cat <<EOF >> $HGRCPATH
62 > cat <<EOF >> $HGRCPATH
63 > commit=
63 > commit=
64 > commit.test=cp a hooktest
64 > commit.test=cp a hooktest
65 > EOF
65 > EOF
66
66
67 $ hg init Test-bndl
67 $ hg init Test-bndl
68 $ cd Test-bndl
68 $ cd Test-bndl
69
69
70 kwshrink should exit silently in empty/invalid repo
70 kwshrink should exit silently in empty/invalid repo
71
71
72 $ hg kwshrink
72 $ hg kwshrink
73
73
74 Symlinks cannot be created on Windows.
74 Symlinks cannot be created on Windows.
75 A bundle to test this was made with:
75 A bundle to test this was made with:
76 hg init t
76 hg init t
77 cd t
77 cd t
78 echo a > a
78 echo a > a
79 ln -s a sym
79 ln -s a sym
80 hg add sym
80 hg add sym
81 hg ci -m addsym -u mercurial
81 hg ci -m addsym -u mercurial
82 hg bundle --base null ../test-keyword.hg
82 hg bundle --base null ../test-keyword.hg
83
83
84 $ hg pull -u "$TESTDIR"/bundles/test-keyword.hg
84 $ hg pull -u "$TESTDIR"/bundles/test-keyword.hg
85 pulling from *test-keyword.hg (glob)
85 pulling from *test-keyword.hg (glob)
86 requesting all changes
86 requesting all changes
87 adding changesets
87 adding changesets
88 adding manifests
88 adding manifests
89 adding file changes
89 adding file changes
90 added 1 changesets with 1 changes to 1 files
90 added 1 changesets with 1 changes to 1 files
91 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
91 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
92
92
93 $ echo 'expand $Id$' > a
93 $ echo 'expand $Id$' > a
94 $ echo 'do not process $Id:' >> a
94 $ echo 'do not process $Id:' >> a
95 $ echo 'xxx $' >> a
95 $ echo 'xxx $' >> a
96 $ echo 'ignore $Id$' > b
96 $ echo 'ignore $Id$' > b
97
97
98 Output files as they were created
98 Output files as they were created
99
99
100 $ cat a b
100 $ cat a b
101 expand $Id$
101 expand $Id$
102 do not process $Id:
102 do not process $Id:
103 xxx $
103 xxx $
104 ignore $Id$
104 ignore $Id$
105
105
106 no kwfiles
106 no kwfiles
107
107
108 $ hg kwfiles
108 $ hg kwfiles
109
109
110 untracked candidates
110 untracked candidates
111
111
112 $ hg -v kwfiles --unknown
112 $ hg -v kwfiles --unknown
113 k a
113 k a
114
114
115 Add files and check status
115 Add files and check status
116
116
117 $ hg addremove
117 $ hg addremove
118 adding a
118 adding a
119 adding b
119 adding b
120 $ hg status
120 $ hg status
121 A a
121 A a
122 A b
122 A b
123
123
124
124
125 Default keyword expansion including commit hook
125 Default keyword expansion including commit hook
126 Interrupted commit should not change state or run commit hook
126 Interrupted commit should not change state or run commit hook
127
127
128 $ hg --debug commit
128 $ hg --debug commit
129 abort: empty commit message
129 abort: empty commit message
130 [255]
130 [255]
131 $ hg status
131 $ hg status
132 A a
132 A a
133 A b
133 A b
134
134
135 Commit with several checks
135 Commit with several checks
136
136
137 $ hg --debug commit -mabsym -u 'User Name <user@example.com>'
137 $ hg --debug commit -mabsym -u 'User Name <user@example.com>'
138 a
138 a
139 b
139 b
140 overwriting a expanding keywords
140 overwriting a expanding keywords
141 running hook commit.test: cp a hooktest
141 running hook commit.test: cp a hooktest
142 committed changeset 1:ef63ca68695bc9495032c6fda1350c71e6d256e9
142 committed changeset 1:ef63ca68695bc9495032c6fda1350c71e6d256e9
143 $ hg status
143 $ hg status
144 ? hooktest
144 ? hooktest
145 $ hg debugrebuildstate
145 $ hg debugrebuildstate
146 $ hg --quiet identify
146 $ hg --quiet identify
147 ef63ca68695b
147 ef63ca68695b
148
148
149 cat files in working directory with keywords expanded
149 cat files in working directory with keywords expanded
150
150
151 $ cat a b
151 $ cat a b
152 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
152 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
153 do not process $Id:
153 do not process $Id:
154 xxx $
154 xxx $
155 ignore $Id$
155 ignore $Id$
156
156
157 hg cat files and symlink, no expansion
157 hg cat files and symlink, no expansion
158
158
159 $ hg cat sym a b && echo
159 $ hg cat sym a b && echo
160 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
160 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
161 do not process $Id:
161 do not process $Id:
162 xxx $
162 xxx $
163 ignore $Id$
163 ignore $Id$
164 a
164 a
165
165
166 $ diff a hooktest
166 $ diff a hooktest
167
167
168 $ cp $HGRCPATH.nohooks $HGRCPATH
168 $ cp $HGRCPATH.nohooks $HGRCPATH
169 $ rm hooktest
169 $ rm hooktest
170
170
171 hg status of kw-ignored binary file starting with '\1\n'
171 hg status of kw-ignored binary file starting with '\1\n'
172
172
173 >>> open("i", "wb").write("\1\nfoo")
173 >>> open("i", "wb").write("\1\nfoo")
174 $ hg -q commit -Am metasep i
174 $ hg -q commit -Am metasep i
175 $ hg status
175 $ hg status
176 >>> open("i", "wb").write("\1\nbar")
176 >>> open("i", "wb").write("\1\nbar")
177 $ hg status
177 $ hg status
178 M i
178 M i
179 $ hg -q commit -m "modify metasep" i
179 $ hg -q commit -m "modify metasep" i
180 $ hg status --rev 2:3
180 $ hg status --rev 2:3
181 M i
181 M i
182 $ touch empty
182 $ touch empty
183 $ hg -q commit -A -m "another file"
183 $ hg -q commit -A -m "another file"
184 $ hg status -A --rev 3:4 i
184 $ hg status -A --rev 3:4 i
185 C i
185 C i
186
186
187 $ hg -q strip -n 2
187 $ hg -q strip -n 2
188
188
189 Test hook execution
189 Test hook execution
190
190
191 bundle
191 bundle
192
192
193 $ hg bundle --base null ../kw.hg
193 $ hg bundle --base null ../kw.hg
194 2 changesets found
194 2 changesets found
195 $ cd ..
195 $ cd ..
196 $ hg init Test
196 $ hg init Test
197 $ cd Test
197 $ cd Test
198
198
199 Notify on pull to check whether keywords stay as is in email
199 Notify on pull to check whether keywords stay as is in email
200 ie. if patch.diff wrapper acts as it should
200 ie. if patch.diff wrapper acts as it should
201
201
202 $ cat <<EOF >> $HGRCPATH
202 $ cat <<EOF >> $HGRCPATH
203 > [hooks]
203 > [hooks]
204 > incoming.notify = python:hgext.notify.hook
204 > incoming.notify = python:hgext.notify.hook
205 > [notify]
205 > [notify]
206 > sources = pull
206 > sources = pull
207 > diffstat = False
207 > diffstat = False
208 > maxsubject = 15
208 > maxsubject = 15
209 > [reposubs]
209 > [reposubs]
210 > * = Test
210 > * = Test
211 > EOF
211 > EOF
212
212
213 Pull from bundle and trigger notify
213 Pull from bundle and trigger notify
214
214
215 $ hg pull -u ../kw.hg
215 $ hg pull -u ../kw.hg
216 pulling from ../kw.hg
216 pulling from ../kw.hg
217 requesting all changes
217 requesting all changes
218 adding changesets
218 adding changesets
219 adding manifests
219 adding manifests
220 adding file changes
220 adding file changes
221 added 2 changesets with 3 changes to 3 files
221 added 2 changesets with 3 changes to 3 files
222 Content-Type: text/plain; charset="us-ascii"
222 Content-Type: text/plain; charset="us-ascii"
223 MIME-Version: 1.0
223 MIME-Version: 1.0
224 Content-Transfer-Encoding: 7bit
224 Content-Transfer-Encoding: 7bit
225 Date: * (glob)
225 Date: * (glob)
226 Subject: changeset in...
226 Subject: changeset in...
227 From: mercurial
227 From: mercurial
228 X-Hg-Notification: changeset a2392c293916
228 X-Hg-Notification: changeset a2392c293916
229 Message-Id: <hg.a2392c293916*> (glob)
229 Message-Id: <hg.a2392c293916*> (glob)
230 To: Test
230 To: Test
231
231
232 changeset a2392c293916 in $TESTTMP/Test (glob)
232 changeset a2392c293916 in $TESTTMP/Test (glob)
233 details: $TESTTMP/Test?cmd=changeset;node=a2392c293916
233 details: $TESTTMP/Test?cmd=changeset;node=a2392c293916
234 description:
234 description:
235 addsym
235 addsym
236
236
237 diffs (6 lines):
237 diffs (6 lines):
238
238
239 diff -r 000000000000 -r a2392c293916 sym
239 diff -r 000000000000 -r a2392c293916 sym
240 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
240 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
241 +++ b/sym Sat Feb 09 20:25:47 2008 +0100
241 +++ b/sym Sat Feb 09 20:25:47 2008 +0100
242 @@ -0,0 +1,1 @@
242 @@ -0,0 +1,1 @@
243 +a
243 +a
244 \ No newline at end of file
244 \ No newline at end of file
245 Content-Type: text/plain; charset="us-ascii"
245 Content-Type: text/plain; charset="us-ascii"
246 MIME-Version: 1.0
246 MIME-Version: 1.0
247 Content-Transfer-Encoding: 7bit
247 Content-Transfer-Encoding: 7bit
248 Date:* (glob)
248 Date:* (glob)
249 Subject: changeset in...
249 Subject: changeset in...
250 From: User Name <user@example.com>
250 From: User Name <user@example.com>
251 X-Hg-Notification: changeset ef63ca68695b
251 X-Hg-Notification: changeset ef63ca68695b
252 Message-Id: <hg.ef63ca68695b*> (glob)
252 Message-Id: <hg.ef63ca68695b*> (glob)
253 To: Test
253 To: Test
254
254
255 changeset ef63ca68695b in $TESTTMP/Test (glob)
255 changeset ef63ca68695b in $TESTTMP/Test (glob)
256 details: $TESTTMP/Test?cmd=changeset;node=ef63ca68695b
256 details: $TESTTMP/Test?cmd=changeset;node=ef63ca68695b
257 description:
257 description:
258 absym
258 absym
259
259
260 diffs (12 lines):
260 diffs (12 lines):
261
261
262 diff -r a2392c293916 -r ef63ca68695b a
262 diff -r a2392c293916 -r ef63ca68695b a
263 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
263 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
264 +++ b/a Thu Jan 01 00:00:00 1970 +0000
264 +++ b/a Thu Jan 01 00:00:00 1970 +0000
265 @@ -0,0 +1,3 @@
265 @@ -0,0 +1,3 @@
266 +expand $Id$
266 +expand $Id$
267 +do not process $Id:
267 +do not process $Id:
268 +xxx $
268 +xxx $
269 diff -r a2392c293916 -r ef63ca68695b b
269 diff -r a2392c293916 -r ef63ca68695b b
270 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
270 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
271 +++ b/b Thu Jan 01 00:00:00 1970 +0000
271 +++ b/b Thu Jan 01 00:00:00 1970 +0000
272 @@ -0,0 +1,1 @@
272 @@ -0,0 +1,1 @@
273 +ignore $Id$
273 +ignore $Id$
274 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
274 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
275
275
276 $ cp $HGRCPATH.nohooks $HGRCPATH
276 $ cp $HGRCPATH.nohooks $HGRCPATH
277
277
278 Touch files and check with status
278 Touch files and check with status
279
279
280 $ touch a b
280 $ touch a b
281 $ hg status
281 $ hg status
282
282
283 Update and expand
283 Update and expand
284
284
285 $ rm sym a b
285 $ rm sym a b
286 $ hg update -C
286 $ hg update -C
287 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
287 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
288 $ cat a b
288 $ cat a b
289 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
289 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
290 do not process $Id:
290 do not process $Id:
291 xxx $
291 xxx $
292 ignore $Id$
292 ignore $Id$
293
293
294 Check whether expansion is filewise and file mode is preserved
294 Check whether expansion is filewise and file mode is preserved
295
295
296 $ echo '$Id$' > c
296 $ echo '$Id$' > c
297 $ echo 'tests for different changenodes' >> c
297 $ echo 'tests for different changenodes' >> c
298 #if unix-permissions
298 #if unix-permissions
299 $ chmod 600 c
299 $ chmod 600 c
300 $ ls -l c | cut -b 1-10
300 $ ls -l c | cut -b 1-10
301 -rw-------
301 -rw-------
302 #endif
302 #endif
303
303
304 commit file c
304 commit file c
305
305
306 $ hg commit -A -mcndiff -d '1 0' -u 'User Name <user@example.com>'
306 $ hg commit -A -mcndiff -d '1 0' -u 'User Name <user@example.com>'
307 adding c
307 adding c
308 #if unix-permissions
308 #if unix-permissions
309 $ ls -l c | cut -b 1-10
309 $ ls -l c | cut -b 1-10
310 -rw-------
310 -rw-------
311 #endif
311 #endif
312
312
313 force expansion
313 force expansion
314
314
315 $ hg -v kwexpand
315 $ hg -v kwexpand
316 overwriting a expanding keywords
316 overwriting a expanding keywords
317 overwriting c expanding keywords
317 overwriting c expanding keywords
318
318
319 compare changenodes in a and c
319 compare changenodes in a and c
320
320
321 $ cat a c
321 $ cat a c
322 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
322 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
323 do not process $Id:
323 do not process $Id:
324 xxx $
324 xxx $
325 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
325 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
326 tests for different changenodes
326 tests for different changenodes
327
327
328 record
328 record
329
329
330 $ echo '$Id$' > r
330 $ echo '$Id$' > r
331 $ hg add r
331 $ hg add r
332
332
333 record chunk
333 record chunk
334
334
335 >>> lines = open('a', 'rb').readlines()
335 >>> lines = open('a', 'rb').readlines()
336 >>> lines.insert(1, 'foo\n')
336 >>> lines.insert(1, 'foo\n')
337 >>> lines.append('bar\n')
337 >>> lines.append('bar\n')
338 >>> open('a', 'wb').writelines(lines)
338 >>> open('a', 'wb').writelines(lines)
339 $ hg record -d '10 1' -m rectest a<<EOF
339 $ hg record -d '10 1' -m rectest a<<EOF
340 > y
340 > y
341 > y
341 > y
342 > n
342 > n
343 > EOF
343 > EOF
344 diff --git a/a b/a
344 diff --git a/a b/a
345 2 hunks, 2 lines changed
345 2 hunks, 2 lines changed
346 examine changes to 'a'? [Ynesfdaq?]
346 examine changes to 'a'? [Ynesfdaq?]
347 @@ -1,3 +1,4 @@
347 @@ -1,3 +1,4 @@
348 expand $Id$
348 expand $Id$
349 +foo
349 +foo
350 do not process $Id:
350 do not process $Id:
351 xxx $
351 xxx $
352 record change 1/2 to 'a'? [Ynesfdaq?]
352 record change 1/2 to 'a'? [Ynesfdaq?]
353 @@ -2,2 +3,3 @@
353 @@ -2,2 +3,3 @@
354 do not process $Id:
354 do not process $Id:
355 xxx $
355 xxx $
356 +bar
356 +bar
357 record change 2/2 to 'a'? [Ynesfdaq?]
357 record change 2/2 to 'a'? [Ynesfdaq?]
358
358
359 $ hg identify
359 $ hg identify
360 5f5eb23505c3+ tip
360 5f5eb23505c3+ tip
361 $ hg status
361 $ hg status
362 M a
362 M a
363 A r
363 A r
364
364
365 Cat modified file a
365 Cat modified file a
366
366
367 $ cat a
367 $ cat a
368 expand $Id: a,v 5f5eb23505c3 1970/01/01 00:00:10 test $
368 expand $Id: a,v 5f5eb23505c3 1970/01/01 00:00:10 test $
369 foo
369 foo
370 do not process $Id:
370 do not process $Id:
371 xxx $
371 xxx $
372 bar
372 bar
373
373
374 Diff remaining chunk
374 Diff remaining chunk
375
375
376 $ hg diff a
376 $ hg diff a
377 diff -r 5f5eb23505c3 a
377 diff -r 5f5eb23505c3 a
378 --- a/a Thu Jan 01 00:00:09 1970 -0000
378 --- a/a Thu Jan 01 00:00:09 1970 -0000
379 +++ b/a * (glob)
379 +++ b/a * (glob)
380 @@ -2,3 +2,4 @@
380 @@ -2,3 +2,4 @@
381 foo
381 foo
382 do not process $Id:
382 do not process $Id:
383 xxx $
383 xxx $
384 +bar
384 +bar
385
385
386 $ hg rollback
386 $ hg rollback
387 repository tip rolled back to revision 2 (undo commit)
387 repository tip rolled back to revision 2 (undo commit)
388 working directory now based on revision 2
388 working directory now based on revision 2
389
389
390 Record all chunks in file a
390 Record all chunks in file a
391
391
392 $ echo foo > msg
392 $ echo foo > msg
393
393
394 - do not use "hg record -m" here!
394 - do not use "hg record -m" here!
395
395
396 $ hg record -l msg -d '11 1' a<<EOF
396 $ hg record -l msg -d '11 1' a<<EOF
397 > y
397 > y
398 > y
398 > y
399 > y
399 > y
400 > EOF
400 > EOF
401 diff --git a/a b/a
401 diff --git a/a b/a
402 2 hunks, 2 lines changed
402 2 hunks, 2 lines changed
403 examine changes to 'a'? [Ynesfdaq?]
403 examine changes to 'a'? [Ynesfdaq?]
404 @@ -1,3 +1,4 @@
404 @@ -1,3 +1,4 @@
405 expand $Id$
405 expand $Id$
406 +foo
406 +foo
407 do not process $Id:
407 do not process $Id:
408 xxx $
408 xxx $
409 record change 1/2 to 'a'? [Ynesfdaq?]
409 record change 1/2 to 'a'? [Ynesfdaq?]
410 @@ -2,2 +3,3 @@
410 @@ -2,2 +3,3 @@
411 do not process $Id:
411 do not process $Id:
412 xxx $
412 xxx $
413 +bar
413 +bar
414 record change 2/2 to 'a'? [Ynesfdaq?]
414 record change 2/2 to 'a'? [Ynesfdaq?]
415
415
416 File a should be clean
416 File a should be clean
417
417
418 $ hg status -A a
418 $ hg status -A a
419 C a
419 C a
420
420
421 rollback and revert expansion
421 rollback and revert expansion
422
422
423 $ cat a
423 $ cat a
424 expand $Id: a,v 78e0a02d76aa 1970/01/01 00:00:11 test $
424 expand $Id: a,v 78e0a02d76aa 1970/01/01 00:00:11 test $
425 foo
425 foo
426 do not process $Id:
426 do not process $Id:
427 xxx $
427 xxx $
428 bar
428 bar
429 $ hg --verbose rollback
429 $ hg --verbose rollback
430 repository tip rolled back to revision 2 (undo commit)
430 repository tip rolled back to revision 2 (undo commit)
431 working directory now based on revision 2
431 working directory now based on revision 2
432 overwriting a expanding keywords
432 overwriting a expanding keywords
433 $ hg status a
433 $ hg status a
434 M a
434 M a
435 $ cat a
435 $ cat a
436 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
436 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
437 foo
437 foo
438 do not process $Id:
438 do not process $Id:
439 xxx $
439 xxx $
440 bar
440 bar
441 $ echo '$Id$' > y
441 $ echo '$Id$' > y
442 $ echo '$Id$' > z
442 $ echo '$Id$' > z
443 $ hg add y
443 $ hg add y
444 $ hg commit -Am "rollback only" z
444 $ hg commit -Am "rollback only" z
445 $ cat z
445 $ cat z
446 $Id: z,v 45a5d3adce53 1970/01/01 00:00:00 test $
446 $Id: z,v 45a5d3adce53 1970/01/01 00:00:00 test $
447 $ hg --verbose rollback
447 $ hg --verbose rollback
448 repository tip rolled back to revision 2 (undo commit)
448 repository tip rolled back to revision 2 (undo commit)
449 working directory now based on revision 2
449 working directory now based on revision 2
450 overwriting z shrinking keywords
450 overwriting z shrinking keywords
451
451
452 Only z should be overwritten
452 Only z should be overwritten
453
453
454 $ hg status a y z
454 $ hg status a y z
455 M a
455 M a
456 A y
456 A y
457 A z
457 A z
458 $ cat z
458 $ cat z
459 $Id$
459 $Id$
460 $ hg forget y z
460 $ hg forget y z
461 $ rm y z
461 $ rm y z
462
462
463 record added file alone
463 record added file alone
464
464
465 $ hg -v record -l msg -d '12 2' r<<EOF
465 $ hg -v record -l msg -d '12 2' r<<EOF
466 > y
466 > y
467 > EOF
467 > EOF
468 diff --git a/r b/r
468 diff --git a/r b/r
469 new file mode 100644
469 new file mode 100644
470 examine changes to 'r'? [Ynesfdaq?]
470 examine changes to 'r'? [Ynesfdaq?]
471 r
471 r
472 committed changeset 3:82a2f715724d
472 committed changeset 3:82a2f715724d
473 overwriting r expanding keywords
473 overwriting r expanding keywords
474 - status call required for dirstate.normallookup() check
474 - status call required for dirstate.normallookup() check
475 $ hg status r
475 $ hg status r
476 $ hg --verbose rollback
476 $ hg --verbose rollback
477 repository tip rolled back to revision 2 (undo commit)
477 repository tip rolled back to revision 2 (undo commit)
478 working directory now based on revision 2
478 working directory now based on revision 2
479 overwriting r shrinking keywords
479 overwriting r shrinking keywords
480 $ hg forget r
480 $ hg forget r
481 $ rm msg r
481 $ rm msg r
482 $ hg update -C
482 $ hg update -C
483 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
483 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
484
484
485 record added keyword ignored file
485 record added keyword ignored file
486
486
487 $ echo '$Id$' > i
487 $ echo '$Id$' > i
488 $ hg add i
488 $ hg add i
489 $ hg --verbose record -d '13 1' -m recignored<<EOF
489 $ hg --verbose record -d '13 1' -m recignored<<EOF
490 > y
490 > y
491 > EOF
491 > EOF
492 diff --git a/i b/i
492 diff --git a/i b/i
493 new file mode 100644
493 new file mode 100644
494 examine changes to 'i'? [Ynesfdaq?]
494 examine changes to 'i'? [Ynesfdaq?]
495 i
495 i
496 committed changeset 3:9f40ceb5a072
496 committed changeset 3:9f40ceb5a072
497 $ cat i
497 $ cat i
498 $Id$
498 $Id$
499 $ hg -q rollback
499 $ hg -q rollback
500 $ hg forget i
500 $ hg forget i
501 $ rm i
501 $ rm i
502
502
503 amend
503 amend
504
504
505 $ echo amend >> a
505 $ echo amend >> a
506 $ echo amend >> b
506 $ echo amend >> b
507 $ hg -q commit -d '14 1' -m 'prepare amend'
507 $ hg -q commit -d '14 1' -m 'prepare amend'
508
508
509 $ hg --debug commit --amend -d '15 1' -m 'amend without changes' | grep keywords
509 $ hg --debug commit --amend -d '15 1' -m 'amend without changes' | grep keywords
510 overwriting a expanding keywords
510 overwriting a expanding keywords
511 $ hg -q id
511 $ hg -q id
512 67d8c481a6be
512 67d8c481a6be
513 $ head -1 a
513 $ head -1 a
514 expand $Id: a,v 67d8c481a6be 1970/01/01 00:00:15 test $
514 expand $Id: a,v 67d8c481a6be 1970/01/01 00:00:15 test $
515
515
516 $ hg -q strip -n tip
516 $ hg -q strip -n tip
517
517
518 Test patch queue repo
518 Test patch queue repo
519
519
520 $ hg init --mq
520 $ hg init --mq
521 $ hg qimport -r tip -n mqtest.diff
521 $ hg qimport -r tip -n mqtest.diff
522 $ hg commit --mq -m mqtest
522 $ hg commit --mq -m mqtest
523
523
524 Keywords should not be expanded in patch
524 Keywords should not be expanded in patch
525
525
526 $ cat .hg/patches/mqtest.diff
526 $ cat .hg/patches/mqtest.diff
527 # HG changeset patch
527 # HG changeset patch
528 # User User Name <user@example.com>
528 # User User Name <user@example.com>
529 # Date 1 0
529 # Date 1 0
530 # Node ID 40a904bbbe4cd4ab0a1f28411e35db26341a40ad
530 # Node ID 40a904bbbe4cd4ab0a1f28411e35db26341a40ad
531 # Parent ef63ca68695bc9495032c6fda1350c71e6d256e9
531 # Parent ef63ca68695bc9495032c6fda1350c71e6d256e9
532 cndiff
532 cndiff
533
533
534 diff -r ef63ca68695b -r 40a904bbbe4c c
534 diff -r ef63ca68695b -r 40a904bbbe4c c
535 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
535 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
536 +++ b/c Thu Jan 01 00:00:01 1970 +0000
536 +++ b/c Thu Jan 01 00:00:01 1970 +0000
537 @@ -0,0 +1,2 @@
537 @@ -0,0 +1,2 @@
538 +$Id$
538 +$Id$
539 +tests for different changenodes
539 +tests for different changenodes
540
540
541 $ hg qpop
541 $ hg qpop
542 popping mqtest.diff
542 popping mqtest.diff
543 patch queue now empty
543 patch queue now empty
544
544
545 qgoto, implying qpush, should expand
545 qgoto, implying qpush, should expand
546
546
547 $ hg qgoto mqtest.diff
547 $ hg qgoto mqtest.diff
548 applying mqtest.diff
548 applying mqtest.diff
549 now at: mqtest.diff
549 now at: mqtest.diff
550 $ cat c
550 $ cat c
551 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
551 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
552 tests for different changenodes
552 tests for different changenodes
553 $ hg cat c
553 $ hg cat c
554 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
554 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
555 tests for different changenodes
555 tests for different changenodes
556
556
557 Keywords should not be expanded in filelog
557 Keywords should not be expanded in filelog
558
558
559 $ hg --config 'extensions.keyword=!' cat c
559 $ hg --config 'extensions.keyword=!' cat c
560 $Id$
560 $Id$
561 tests for different changenodes
561 tests for different changenodes
562
562
563 qpop and move on
563 qpop and move on
564
564
565 $ hg qpop
565 $ hg qpop
566 popping mqtest.diff
566 popping mqtest.diff
567 patch queue now empty
567 patch queue now empty
568
568
569 Copy and show added kwfiles
569 Copy and show added kwfiles
570
570
571 $ hg cp a c
571 $ hg cp a c
572 $ hg kwfiles
572 $ hg kwfiles
573 a
573 a
574 c
574 c
575
575
576 Commit and show expansion in original and copy
576 Commit and show expansion in original and copy
577
577
578 $ hg --debug commit -ma2c -d '1 0' -u 'User Name <user@example.com>'
578 $ hg --debug commit -ma2c -d '1 0' -u 'User Name <user@example.com>'
579 c
579 c
580 c: copy a:0045e12f6c5791aac80ca6cbfd97709a88307292
580 c: copy a:0045e12f6c5791aac80ca6cbfd97709a88307292
581 overwriting c expanding keywords
581 overwriting c expanding keywords
582 committed changeset 2:25736cf2f5cbe41f6be4e6784ef6ecf9f3bbcc7d
582 committed changeset 2:25736cf2f5cbe41f6be4e6784ef6ecf9f3bbcc7d
583 $ cat a c
583 $ cat a c
584 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
584 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
585 do not process $Id:
585 do not process $Id:
586 xxx $
586 xxx $
587 expand $Id: c,v 25736cf2f5cb 1970/01/01 00:00:01 user $
587 expand $Id: c,v 25736cf2f5cb 1970/01/01 00:00:01 user $
588 do not process $Id:
588 do not process $Id:
589 xxx $
589 xxx $
590
590
591 Touch copied c and check its status
591 Touch copied c and check its status
592
592
593 $ touch c
593 $ touch c
594 $ hg status
594 $ hg status
595
595
596 Copy kwfile to keyword ignored file unexpanding keywords
596 Copy kwfile to keyword ignored file unexpanding keywords
597
597
598 $ hg --verbose copy a i
598 $ hg --verbose copy a i
599 copying a to i
599 copying a to i
600 overwriting i shrinking keywords
600 overwriting i shrinking keywords
601 $ head -n 1 i
601 $ head -n 1 i
602 expand $Id$
602 expand $Id$
603 $ hg forget i
603 $ hg forget i
604 $ rm i
604 $ rm i
605
605
606 Copy ignored file to ignored file: no overwriting
606 Copy ignored file to ignored file: no overwriting
607
607
608 $ hg --verbose copy b i
608 $ hg --verbose copy b i
609 copying b to i
609 copying b to i
610 $ hg forget i
610 $ hg forget i
611 $ rm i
611 $ rm i
612
612
613 cp symlink file; hg cp -A symlink file (part1)
613 cp symlink file; hg cp -A symlink file (part1)
614 - copied symlink points to kwfile: overwrite
614 - copied symlink points to kwfile: overwrite
615
615
616 #if symlink
616 #if symlink
617 $ cp sym i
617 $ cp sym i
618 $ ls -l i
618 $ ls -l i
619 -rw-r--r--* (glob)
619 -rw-r--r--* (glob)
620 $ head -1 i
620 $ head -1 i
621 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
621 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
622 $ hg copy --after --verbose sym i
622 $ hg copy --after --verbose sym i
623 copying sym to i
623 copying sym to i
624 overwriting i shrinking keywords
624 overwriting i shrinking keywords
625 $ head -1 i
625 $ head -1 i
626 expand $Id$
626 expand $Id$
627 $ hg forget i
627 $ hg forget i
628 $ rm i
628 $ rm i
629 #endif
629 #endif
630
630
631 Test different options of hg kwfiles
631 Test different options of hg kwfiles
632
632
633 $ hg kwfiles
633 $ hg kwfiles
634 a
634 a
635 c
635 c
636 $ hg -v kwfiles --ignore
636 $ hg -v kwfiles --ignore
637 I b
637 I b
638 I sym
638 I sym
639 $ hg kwfiles --all
639 $ hg kwfiles --all
640 K a
640 K a
641 K c
641 K c
642 I b
642 I b
643 I sym
643 I sym
644
644
645 Diff specific revision
645 Diff specific revision
646
646
647 $ hg diff --rev 1
647 $ hg diff --rev 1
648 diff -r ef63ca68695b c
648 diff -r ef63ca68695b c
649 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
649 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
650 +++ b/c * (glob)
650 +++ b/c * (glob)
651 @@ -0,0 +1,3 @@
651 @@ -0,0 +1,3 @@
652 +expand $Id$
652 +expand $Id$
653 +do not process $Id:
653 +do not process $Id:
654 +xxx $
654 +xxx $
655
655
656 Status after rollback:
656 Status after rollback:
657
657
658 $ hg rollback
658 $ hg rollback
659 repository tip rolled back to revision 1 (undo commit)
659 repository tip rolled back to revision 1 (undo commit)
660 working directory now based on revision 1
660 working directory now based on revision 1
661 $ hg status
661 $ hg status
662 A c
662 A c
663 $ hg update --clean
663 $ hg update --clean
664 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
664 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
665
665
666 #if symlink
666 #if symlink
667
667
668 cp symlink file; hg cp -A symlink file (part2)
668 cp symlink file; hg cp -A symlink file (part2)
669 - copied symlink points to kw ignored file: do not overwrite
669 - copied symlink points to kw ignored file: do not overwrite
670
670
671 $ cat a > i
671 $ cat a > i
672 $ ln -s i symignored
672 $ ln -s i symignored
673 $ hg commit -Am 'fake expansion in ignored and symlink' i symignored
673 $ hg commit -Am 'fake expansion in ignored and symlink' i symignored
674 $ cp symignored x
674 $ cp symignored x
675 $ hg copy --after --verbose symignored x
675 $ hg copy --after --verbose symignored x
676 copying symignored to x
676 copying symignored to x
677 $ head -n 1 x
677 $ head -n 1 x
678 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
678 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
679 $ hg forget x
679 $ hg forget x
680 $ rm x
680 $ rm x
681
681
682 $ hg rollback
682 $ hg rollback
683 repository tip rolled back to revision 1 (undo commit)
683 repository tip rolled back to revision 1 (undo commit)
684 working directory now based on revision 1
684 working directory now based on revision 1
685 $ hg update --clean
685 $ hg update --clean
686 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
686 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
687 $ rm i symignored
687 $ rm i symignored
688
688
689 #endif
689 #endif
690
690
691 Custom keywordmaps as argument to kwdemo
691 Custom keywordmaps as argument to kwdemo
692
692
693 $ hg --quiet kwdemo "Xinfo = {author}: {desc}"
693 $ hg --quiet kwdemo "Xinfo = {author}: {desc}"
694 [extensions]
694 [extensions]
695 keyword =
695 keyword =
696 [keyword]
696 [keyword]
697 ** =
697 ** =
698 b = ignore
698 b = ignore
699 demo.txt =
699 demo.txt =
700 i = ignore
700 i = ignore
701 [keywordset]
701 [keywordset]
702 svn = False
702 svn = False
703 [keywordmaps]
703 [keywordmaps]
704 Xinfo = {author}: {desc}
704 Xinfo = {author}: {desc}
705 $Xinfo: test: hg keyword configuration and expansion example $
705 $Xinfo: test: hg keyword configuration and expansion example $
706
706
707 Configure custom keywordmaps
707 Configure custom keywordmaps
708
708
709 $ cat <<EOF >>$HGRCPATH
709 $ cat <<EOF >>$HGRCPATH
710 > [keywordmaps]
710 > [keywordmaps]
711 > Id = {file} {node|short} {date|rfc822date} {author|user}
711 > Id = {file} {node|short} {date|rfc822date} {author|user}
712 > Xinfo = {author}: {desc}
712 > Xinfo = {author}: {desc}
713 > EOF
713 > EOF
714
714
715 Cat and hg cat files before custom expansion
715 Cat and hg cat files before custom expansion
716
716
717 $ cat a b
717 $ cat a b
718 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
718 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
719 do not process $Id:
719 do not process $Id:
720 xxx $
720 xxx $
721 ignore $Id$
721 ignore $Id$
722 $ hg cat sym a b && echo
722 $ hg cat sym a b && echo
723 expand $Id: a ef63ca68695b Thu, 01 Jan 1970 00:00:00 +0000 user $
723 expand $Id: a ef63ca68695b Thu, 01 Jan 1970 00:00:00 +0000 user $
724 do not process $Id:
724 do not process $Id:
725 xxx $
725 xxx $
726 ignore $Id$
726 ignore $Id$
727 a
727 a
728
728
729 Write custom keyword and prepare multi-line commit message
729 Write custom keyword and prepare multi-line commit message
730
730
731 $ echo '$Xinfo$' >> a
731 $ echo '$Xinfo$' >> a
732 $ cat <<EOF >> log
732 $ cat <<EOF >> log
733 > firstline
733 > firstline
734 > secondline
734 > secondline
735 > EOF
735 > EOF
736
736
737 Interrupted commit should not change state
737 Interrupted commit should not change state
738
738
739 $ hg commit
739 $ hg commit
740 abort: empty commit message
740 abort: empty commit message
741 [255]
741 [255]
742 $ hg status
742 $ hg status
743 M a
743 M a
744 ? c
744 ? c
745 ? log
745 ? log
746
746
747 Commit with multi-line message and custom expansion
747 Commit with multi-line message and custom expansion
748
748
749 $ hg --debug commit -l log -d '2 0' -u 'User Name <user@example.com>'
749 $ hg --debug commit -l log -d '2 0' -u 'User Name <user@example.com>'
750 invalid branchheads cache: tip differs
750 a
751 a
752 invalid branchheads cache: tip differs
751 overwriting a expanding keywords
753 overwriting a expanding keywords
752 committed changeset 2:bb948857c743469b22bbf51f7ec8112279ca5d83
754 committed changeset 2:bb948857c743469b22bbf51f7ec8112279ca5d83
753 $ rm log
755 $ rm log
754
756
755 Stat, verify and show custom expansion (firstline)
757 Stat, verify and show custom expansion (firstline)
756
758
757 $ hg status
759 $ hg status
758 ? c
760 ? c
759 $ hg verify
761 $ hg verify
760 checking changesets
762 checking changesets
761 checking manifests
763 checking manifests
762 crosschecking files in changesets and manifests
764 crosschecking files in changesets and manifests
763 checking files
765 checking files
764 3 files, 3 changesets, 4 total revisions
766 3 files, 3 changesets, 4 total revisions
765 $ cat a b
767 $ cat a b
766 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
768 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
767 do not process $Id:
769 do not process $Id:
768 xxx $
770 xxx $
769 $Xinfo: User Name <user@example.com>: firstline $
771 $Xinfo: User Name <user@example.com>: firstline $
770 ignore $Id$
772 ignore $Id$
771 $ hg cat sym a b && echo
773 $ hg cat sym a b && echo
772 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
774 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
773 do not process $Id:
775 do not process $Id:
774 xxx $
776 xxx $
775 $Xinfo: User Name <user@example.com>: firstline $
777 $Xinfo: User Name <user@example.com>: firstline $
776 ignore $Id$
778 ignore $Id$
777 a
779 a
778
780
779 annotate
781 annotate
780
782
781 $ hg annotate a
783 $ hg annotate a
782 1: expand $Id$
784 1: expand $Id$
783 1: do not process $Id:
785 1: do not process $Id:
784 1: xxx $
786 1: xxx $
785 2: $Xinfo$
787 2: $Xinfo$
786
788
787 remove with status checks
789 remove with status checks
788
790
789 $ hg debugrebuildstate
791 $ hg debugrebuildstate
790 $ hg remove a
792 $ hg remove a
791 $ hg --debug commit -m rma
793 $ hg --debug commit -m rma
794 invalid branchheads cache: tip differs
795 invalid branchheads cache: tip differs
792 committed changeset 3:d14c712653769de926994cf7fbb06c8fbd68f012
796 committed changeset 3:d14c712653769de926994cf7fbb06c8fbd68f012
793 $ hg status
797 $ hg status
794 ? c
798 ? c
795
799
796 Rollback, revert, and check expansion
800 Rollback, revert, and check expansion
797
801
798 $ hg rollback
802 $ hg rollback
799 repository tip rolled back to revision 2 (undo commit)
803 repository tip rolled back to revision 2 (undo commit)
800 working directory now based on revision 2
804 working directory now based on revision 2
801 $ hg status
805 $ hg status
802 R a
806 R a
803 ? c
807 ? c
804 $ hg revert --no-backup --rev tip a
808 $ hg revert --no-backup --rev tip a
805 $ cat a
809 $ cat a
806 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
810 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
807 do not process $Id:
811 do not process $Id:
808 xxx $
812 xxx $
809 $Xinfo: User Name <user@example.com>: firstline $
813 $Xinfo: User Name <user@example.com>: firstline $
810
814
811 Clone to test global and local configurations
815 Clone to test global and local configurations
812
816
813 $ cd ..
817 $ cd ..
814
818
815 Expansion in destination with global configuration
819 Expansion in destination with global configuration
816
820
817 $ hg --quiet clone Test globalconf
821 $ hg --quiet clone Test globalconf
818 $ cat globalconf/a
822 $ cat globalconf/a
819 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
823 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
820 do not process $Id:
824 do not process $Id:
821 xxx $
825 xxx $
822 $Xinfo: User Name <user@example.com>: firstline $
826 $Xinfo: User Name <user@example.com>: firstline $
823
827
824 No expansion in destination with local configuration in origin only
828 No expansion in destination with local configuration in origin only
825
829
826 $ hg --quiet --config 'keyword.**=ignore' clone Test localconf
830 $ hg --quiet --config 'keyword.**=ignore' clone Test localconf
827 $ cat localconf/a
831 $ cat localconf/a
828 expand $Id$
832 expand $Id$
829 do not process $Id:
833 do not process $Id:
830 xxx $
834 xxx $
831 $Xinfo$
835 $Xinfo$
832
836
833 Clone to test incoming
837 Clone to test incoming
834
838
835 $ hg clone -r1 Test Test-a
839 $ hg clone -r1 Test Test-a
836 adding changesets
840 adding changesets
837 adding manifests
841 adding manifests
838 adding file changes
842 adding file changes
839 added 2 changesets with 3 changes to 3 files
843 added 2 changesets with 3 changes to 3 files
840 updating to branch default
844 updating to branch default
841 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
845 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
842 $ cd Test-a
846 $ cd Test-a
843 $ cat <<EOF >> .hg/hgrc
847 $ cat <<EOF >> .hg/hgrc
844 > [paths]
848 > [paths]
845 > default = ../Test
849 > default = ../Test
846 > EOF
850 > EOF
847 $ hg incoming
851 $ hg incoming
848 comparing with $TESTTMP/Test (glob)
852 comparing with $TESTTMP/Test (glob)
849 searching for changes
853 searching for changes
850 changeset: 2:bb948857c743
854 changeset: 2:bb948857c743
851 tag: tip
855 tag: tip
852 user: User Name <user@example.com>
856 user: User Name <user@example.com>
853 date: Thu Jan 01 00:00:02 1970 +0000
857 date: Thu Jan 01 00:00:02 1970 +0000
854 summary: firstline
858 summary: firstline
855
859
856 Imported patch should not be rejected
860 Imported patch should not be rejected
857
861
858 >>> import re
862 >>> import re
859 >>> text = re.sub(r'(Id.*)', r'\1 rejecttest', open('a').read())
863 >>> text = re.sub(r'(Id.*)', r'\1 rejecttest', open('a').read())
860 >>> open('a', 'wb').write(text)
864 >>> open('a', 'wb').write(text)
861 $ hg --debug commit -m'rejects?' -d '3 0' -u 'User Name <user@example.com>'
865 $ hg --debug commit -m'rejects?' -d '3 0' -u 'User Name <user@example.com>'
862 a
866 a
863 overwriting a expanding keywords
867 overwriting a expanding keywords
864 committed changeset 2:85e279d709ffc28c9fdd1b868570985fc3d87082
868 committed changeset 2:85e279d709ffc28c9fdd1b868570985fc3d87082
865 $ hg export -o ../rejecttest.diff tip
869 $ hg export -o ../rejecttest.diff tip
866 $ cd ../Test
870 $ cd ../Test
867 $ hg import ../rejecttest.diff
871 $ hg import ../rejecttest.diff
868 applying ../rejecttest.diff
872 applying ../rejecttest.diff
869 $ cat a b
873 $ cat a b
870 expand $Id: a 4e0994474d25 Thu, 01 Jan 1970 00:00:03 +0000 user $ rejecttest
874 expand $Id: a 4e0994474d25 Thu, 01 Jan 1970 00:00:03 +0000 user $ rejecttest
871 do not process $Id: rejecttest
875 do not process $Id: rejecttest
872 xxx $
876 xxx $
873 $Xinfo: User Name <user@example.com>: rejects? $
877 $Xinfo: User Name <user@example.com>: rejects? $
874 ignore $Id$
878 ignore $Id$
875
879
876 $ hg rollback
880 $ hg rollback
877 repository tip rolled back to revision 2 (undo import)
881 repository tip rolled back to revision 2 (undo import)
878 working directory now based on revision 2
882 working directory now based on revision 2
879 $ hg update --clean
883 $ hg update --clean
880 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
884 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
881
885
882 kwexpand/kwshrink on selected files
886 kwexpand/kwshrink on selected files
883
887
884 $ mkdir x
888 $ mkdir x
885 $ hg copy a x/a
889 $ hg copy a x/a
886 $ hg --verbose kwshrink a
890 $ hg --verbose kwshrink a
887 overwriting a shrinking keywords
891 overwriting a shrinking keywords
888 - sleep required for dirstate.normal() check
892 - sleep required for dirstate.normal() check
889 $ sleep 1
893 $ sleep 1
890 $ hg status a
894 $ hg status a
891 $ hg --verbose kwexpand a
895 $ hg --verbose kwexpand a
892 overwriting a expanding keywords
896 overwriting a expanding keywords
893 $ hg status a
897 $ hg status a
894
898
895 kwexpand x/a should abort
899 kwexpand x/a should abort
896
900
897 $ hg --verbose kwexpand x/a
901 $ hg --verbose kwexpand x/a
898 abort: outstanding uncommitted changes
902 abort: outstanding uncommitted changes
899 [255]
903 [255]
900 $ cd x
904 $ cd x
901 $ hg --debug commit -m xa -d '3 0' -u 'User Name <user@example.com>'
905 $ hg --debug commit -m xa -d '3 0' -u 'User Name <user@example.com>'
906 invalid branchheads cache: tip differs
902 x/a
907 x/a
903 x/a: copy a:779c764182ce5d43e2b1eb66ce06d7b47bfe342e
908 x/a: copy a:779c764182ce5d43e2b1eb66ce06d7b47bfe342e
909 invalid branchheads cache: tip differs
904 overwriting x/a expanding keywords
910 overwriting x/a expanding keywords
905 committed changeset 3:b4560182a3f9a358179fd2d835c15e9da379c1e4
911 committed changeset 3:b4560182a3f9a358179fd2d835c15e9da379c1e4
906 $ cat a
912 $ cat a
907 expand $Id: x/a b4560182a3f9 Thu, 01 Jan 1970 00:00:03 +0000 user $
913 expand $Id: x/a b4560182a3f9 Thu, 01 Jan 1970 00:00:03 +0000 user $
908 do not process $Id:
914 do not process $Id:
909 xxx $
915 xxx $
910 $Xinfo: User Name <user@example.com>: xa $
916 $Xinfo: User Name <user@example.com>: xa $
911
917
912 kwshrink a inside directory x
918 kwshrink a inside directory x
913
919
914 $ hg --verbose kwshrink a
920 $ hg --verbose kwshrink a
915 overwriting x/a shrinking keywords
921 overwriting x/a shrinking keywords
916 $ cat a
922 $ cat a
917 expand $Id$
923 expand $Id$
918 do not process $Id:
924 do not process $Id:
919 xxx $
925 xxx $
920 $Xinfo$
926 $Xinfo$
921 $ cd ..
927 $ cd ..
922
928
923 kwexpand nonexistent
929 kwexpand nonexistent
924
930
925 $ hg kwexpand nonexistent
931 $ hg kwexpand nonexistent
926 nonexistent:* (glob)
932 nonexistent:* (glob)
927
933
928
934
929 #if serve
935 #if serve
930 hg serve
936 hg serve
931 - expand with hgweb file
937 - expand with hgweb file
932 - no expansion with hgweb annotate/changeset/filediff
938 - no expansion with hgweb annotate/changeset/filediff
933 - check errors
939 - check errors
934
940
935 $ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
941 $ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
936 $ cat hg.pid >> $DAEMON_PIDS
942 $ cat hg.pid >> $DAEMON_PIDS
937 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT 'file/tip/a/?style=raw'
943 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT 'file/tip/a/?style=raw'
938 200 Script output follows
944 200 Script output follows
939
945
940 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
946 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
941 do not process $Id:
947 do not process $Id:
942 xxx $
948 xxx $
943 $Xinfo: User Name <user@example.com>: firstline $
949 $Xinfo: User Name <user@example.com>: firstline $
944 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT 'annotate/tip/a/?style=raw'
950 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT 'annotate/tip/a/?style=raw'
945 200 Script output follows
951 200 Script output follows
946
952
947
953
948 user@1: expand $Id$
954 user@1: expand $Id$
949 user@1: do not process $Id:
955 user@1: do not process $Id:
950 user@1: xxx $
956 user@1: xxx $
951 user@2: $Xinfo$
957 user@2: $Xinfo$
952
958
953
959
954
960
955
961
956 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT 'rev/tip/?style=raw'
962 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT 'rev/tip/?style=raw'
957 200 Script output follows
963 200 Script output follows
958
964
959
965
960 # HG changeset patch
966 # HG changeset patch
961 # User User Name <user@example.com>
967 # User User Name <user@example.com>
962 # Date 3 0
968 # Date 3 0
963 # Node ID b4560182a3f9a358179fd2d835c15e9da379c1e4
969 # Node ID b4560182a3f9a358179fd2d835c15e9da379c1e4
964 # Parent bb948857c743469b22bbf51f7ec8112279ca5d83
970 # Parent bb948857c743469b22bbf51f7ec8112279ca5d83
965 xa
971 xa
966
972
967 diff -r bb948857c743 -r b4560182a3f9 x/a
973 diff -r bb948857c743 -r b4560182a3f9 x/a
968 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
974 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
969 +++ b/x/a Thu Jan 01 00:00:03 1970 +0000
975 +++ b/x/a Thu Jan 01 00:00:03 1970 +0000
970 @@ -0,0 +1,4 @@
976 @@ -0,0 +1,4 @@
971 +expand $Id$
977 +expand $Id$
972 +do not process $Id:
978 +do not process $Id:
973 +xxx $
979 +xxx $
974 +$Xinfo$
980 +$Xinfo$
975
981
976 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT 'diff/bb948857c743/a?style=raw'
982 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT 'diff/bb948857c743/a?style=raw'
977 200 Script output follows
983 200 Script output follows
978
984
979
985
980 diff -r ef63ca68695b -r bb948857c743 a
986 diff -r ef63ca68695b -r bb948857c743 a
981 --- a/a Thu Jan 01 00:00:00 1970 +0000
987 --- a/a Thu Jan 01 00:00:00 1970 +0000
982 +++ b/a Thu Jan 01 00:00:02 1970 +0000
988 +++ b/a Thu Jan 01 00:00:02 1970 +0000
983 @@ -1,3 +1,4 @@
989 @@ -1,3 +1,4 @@
984 expand $Id$
990 expand $Id$
985 do not process $Id:
991 do not process $Id:
986 xxx $
992 xxx $
987 +$Xinfo$
993 +$Xinfo$
988
994
989
995
990
996
991
997
992 $ cat errors.log
998 $ cat errors.log
993 #endif
999 #endif
994
1000
995 Prepare merge and resolve tests
1001 Prepare merge and resolve tests
996
1002
997 $ echo '$Id$' > m
1003 $ echo '$Id$' > m
998 $ hg add m
1004 $ hg add m
999 $ hg commit -m 4kw
1005 $ hg commit -m 4kw
1000 $ echo foo >> m
1006 $ echo foo >> m
1001 $ hg commit -m 5foo
1007 $ hg commit -m 5foo
1002
1008
1003 simplemerge
1009 simplemerge
1004
1010
1005 $ hg update 4
1011 $ hg update 4
1006 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1012 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1007 $ echo foo >> m
1013 $ echo foo >> m
1008 $ hg commit -m 6foo
1014 $ hg commit -m 6foo
1009 created new head
1015 created new head
1010 $ hg merge
1016 $ hg merge
1011 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1017 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1012 (branch merge, don't forget to commit)
1018 (branch merge, don't forget to commit)
1013 $ hg commit -m simplemerge
1019 $ hg commit -m simplemerge
1014 $ cat m
1020 $ cat m
1015 $Id: m 27d48ee14f67 Thu, 01 Jan 1970 00:00:00 +0000 test $
1021 $Id: m 27d48ee14f67 Thu, 01 Jan 1970 00:00:00 +0000 test $
1016 foo
1022 foo
1017
1023
1018 conflict: keyword should stay outside conflict zone
1024 conflict: keyword should stay outside conflict zone
1019
1025
1020 $ hg update 4
1026 $ hg update 4
1021 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1027 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1022 $ echo bar >> m
1028 $ echo bar >> m
1023 $ hg commit -m 8bar
1029 $ hg commit -m 8bar
1024 created new head
1030 created new head
1025 $ hg merge
1031 $ hg merge
1026 merging m
1032 merging m
1027 warning: conflicts during merge.
1033 warning: conflicts during merge.
1028 merging m incomplete! (edit conflicts, then use 'hg resolve --mark')
1034 merging m incomplete! (edit conflicts, then use 'hg resolve --mark')
1029 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
1035 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
1030 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
1036 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
1031 [1]
1037 [1]
1032 $ cat m
1038 $ cat m
1033 $Id$
1039 $Id$
1034 <<<<<<< local
1040 <<<<<<< local
1035 bar
1041 bar
1036 =======
1042 =======
1037 foo
1043 foo
1038 >>>>>>> other
1044 >>>>>>> other
1039
1045
1040 resolve to local
1046 resolve to local
1041
1047
1042 $ HGMERGE=internal:local hg resolve -a
1048 $ HGMERGE=internal:local hg resolve -a
1043 $ hg commit -m localresolve
1049 $ hg commit -m localresolve
1044 $ cat m
1050 $ cat m
1045 $Id: m 800511b3a22d Thu, 01 Jan 1970 00:00:00 +0000 test $
1051 $Id: m 800511b3a22d Thu, 01 Jan 1970 00:00:00 +0000 test $
1046 bar
1052 bar
1047
1053
1048 Test restricted mode with transplant -b
1054 Test restricted mode with transplant -b
1049
1055
1050 $ hg update 6
1056 $ hg update 6
1051 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1057 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1052 $ hg branch foo
1058 $ hg branch foo
1053 marked working directory as branch foo
1059 marked working directory as branch foo
1054 (branches are permanent and global, did you want a bookmark?)
1060 (branches are permanent and global, did you want a bookmark?)
1055 $ mv a a.bak
1061 $ mv a a.bak
1056 $ echo foobranch > a
1062 $ echo foobranch > a
1057 $ cat a.bak >> a
1063 $ cat a.bak >> a
1058 $ rm a.bak
1064 $ rm a.bak
1059 $ hg commit -m 9foobranch
1065 $ hg commit -m 9foobranch
1060 $ hg update default
1066 $ hg update default
1061 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1067 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1062 $ hg -y transplant -b foo tip
1068 $ hg -y transplant -b foo tip
1063 applying 4aa30d025d50
1069 applying 4aa30d025d50
1064 4aa30d025d50 transplanted to e00abbf63521
1070 4aa30d025d50 transplanted to e00abbf63521
1065
1071
1066 Expansion in changeset but not in file
1072 Expansion in changeset but not in file
1067
1073
1068 $ hg tip -p
1074 $ hg tip -p
1069 changeset: 11:e00abbf63521
1075 changeset: 11:e00abbf63521
1070 tag: tip
1076 tag: tip
1071 parent: 9:800511b3a22d
1077 parent: 9:800511b3a22d
1072 user: test
1078 user: test
1073 date: Thu Jan 01 00:00:00 1970 +0000
1079 date: Thu Jan 01 00:00:00 1970 +0000
1074 summary: 9foobranch
1080 summary: 9foobranch
1075
1081
1076 diff -r 800511b3a22d -r e00abbf63521 a
1082 diff -r 800511b3a22d -r e00abbf63521 a
1077 --- a/a Thu Jan 01 00:00:00 1970 +0000
1083 --- a/a Thu Jan 01 00:00:00 1970 +0000
1078 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1084 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1079 @@ -1,3 +1,4 @@
1085 @@ -1,3 +1,4 @@
1080 +foobranch
1086 +foobranch
1081 expand $Id$
1087 expand $Id$
1082 do not process $Id:
1088 do not process $Id:
1083 xxx $
1089 xxx $
1084
1090
1085 $ head -n 2 a
1091 $ head -n 2 a
1086 foobranch
1092 foobranch
1087 expand $Id: a e00abbf63521 Thu, 01 Jan 1970 00:00:00 +0000 test $
1093 expand $Id: a e00abbf63521 Thu, 01 Jan 1970 00:00:00 +0000 test $
1088
1094
1089 Turn off expansion
1095 Turn off expansion
1090
1096
1091 $ hg -q rollback
1097 $ hg -q rollback
1092 $ hg -q update -C
1098 $ hg -q update -C
1093
1099
1094 kwshrink with unknown file u
1100 kwshrink with unknown file u
1095
1101
1096 $ cp a u
1102 $ cp a u
1097 $ hg --verbose kwshrink
1103 $ hg --verbose kwshrink
1098 overwriting a shrinking keywords
1104 overwriting a shrinking keywords
1099 overwriting m shrinking keywords
1105 overwriting m shrinking keywords
1100 overwriting x/a shrinking keywords
1106 overwriting x/a shrinking keywords
1101
1107
1102 Keywords shrunk in working directory, but not yet disabled
1108 Keywords shrunk in working directory, but not yet disabled
1103 - cat shows unexpanded keywords
1109 - cat shows unexpanded keywords
1104 - hg cat shows expanded keywords
1110 - hg cat shows expanded keywords
1105
1111
1106 $ cat a b
1112 $ cat a b
1107 expand $Id$
1113 expand $Id$
1108 do not process $Id:
1114 do not process $Id:
1109 xxx $
1115 xxx $
1110 $Xinfo$
1116 $Xinfo$
1111 ignore $Id$
1117 ignore $Id$
1112 $ hg cat sym a b && echo
1118 $ hg cat sym a b && echo
1113 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
1119 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
1114 do not process $Id:
1120 do not process $Id:
1115 xxx $
1121 xxx $
1116 $Xinfo: User Name <user@example.com>: firstline $
1122 $Xinfo: User Name <user@example.com>: firstline $
1117 ignore $Id$
1123 ignore $Id$
1118 a
1124 a
1119
1125
1120 Now disable keyword expansion
1126 Now disable keyword expansion
1121
1127
1122 $ rm "$HGRCPATH"
1128 $ rm "$HGRCPATH"
1123 $ cat a b
1129 $ cat a b
1124 expand $Id$
1130 expand $Id$
1125 do not process $Id:
1131 do not process $Id:
1126 xxx $
1132 xxx $
1127 $Xinfo$
1133 $Xinfo$
1128 ignore $Id$
1134 ignore $Id$
1129 $ hg cat sym a b && echo
1135 $ hg cat sym a b && echo
1130 expand $Id$
1136 expand $Id$
1131 do not process $Id:
1137 do not process $Id:
1132 xxx $
1138 xxx $
1133 $Xinfo$
1139 $Xinfo$
1134 ignore $Id$
1140 ignore $Id$
1135 a
1141 a
1136
1142
1137 $ cd ..
1143 $ cd ..
@@ -1,330 +1,345 b''
1 $ branchcache=.hg/cache/branchheads
1 $ branchcache=.hg/cache/branchheads
2
2
3 $ listbranchcaches() {
4 > for f in .hg/cache/branchheads*;
5 > do echo === $f ===;
6 > cat $f;
7 > done;
8 > }
9 $ purgebranchcaches() {
10 > rm .hg/cache/branchheads*
11 > }
12
3 $ hg init t
13 $ hg init t
4 $ cd t
14 $ cd t
5
15
6 $ hg branches
16 $ hg branches
7 $ echo foo > a
17 $ echo foo > a
8 $ hg add a
18 $ hg add a
9 $ hg ci -m "initial"
19 $ hg ci -m "initial"
10 $ hg branch foo
20 $ hg branch foo
11 marked working directory as branch foo
21 marked working directory as branch foo
12 (branches are permanent and global, did you want a bookmark?)
22 (branches are permanent and global, did you want a bookmark?)
13 $ hg branch
23 $ hg branch
14 foo
24 foo
15 $ hg ci -m "add branch name"
25 $ hg ci -m "add branch name"
16 $ hg branch bar
26 $ hg branch bar
17 marked working directory as branch bar
27 marked working directory as branch bar
18 (branches are permanent and global, did you want a bookmark?)
28 (branches are permanent and global, did you want a bookmark?)
19 $ hg ci -m "change branch name"
29 $ hg ci -m "change branch name"
20
30
21 Branch shadowing:
31 Branch shadowing:
22
32
23 $ hg branch default
33 $ hg branch default
24 abort: a branch of the same name already exists
34 abort: a branch of the same name already exists
25 (use 'hg update' to switch to it)
35 (use 'hg update' to switch to it)
26 [255]
36 [255]
27
37
28 $ hg branch -f default
38 $ hg branch -f default
29 marked working directory as branch default
39 marked working directory as branch default
30 (branches are permanent and global, did you want a bookmark?)
40 (branches are permanent and global, did you want a bookmark?)
31
41
32 $ hg ci -m "clear branch name"
42 $ hg ci -m "clear branch name"
33 created new head
43 created new head
34
44
35 There should be only one default branch head
45 There should be only one default branch head
36
46
37 $ hg heads .
47 $ hg heads .
38 changeset: 3:1c28f494dae6
48 changeset: 3:1c28f494dae6
39 tag: tip
49 tag: tip
40 user: test
50 user: test
41 date: Thu Jan 01 00:00:00 1970 +0000
51 date: Thu Jan 01 00:00:00 1970 +0000
42 summary: clear branch name
52 summary: clear branch name
43
53
44
54
45 $ hg co foo
55 $ hg co foo
46 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
56 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
47 $ hg branch
57 $ hg branch
48 foo
58 foo
49 $ echo bleah > a
59 $ echo bleah > a
50 $ hg ci -m "modify a branch"
60 $ hg ci -m "modify a branch"
51
61
52 $ hg merge default
62 $ hg merge default
53 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
63 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
54 (branch merge, don't forget to commit)
64 (branch merge, don't forget to commit)
55
65
56 $ hg branch
66 $ hg branch
57 foo
67 foo
58 $ hg ci -m "merge"
68 $ hg ci -m "merge"
59
69
60 $ hg log
70 $ hg log
61 changeset: 5:530046499edf
71 changeset: 5:530046499edf
62 branch: foo
72 branch: foo
63 tag: tip
73 tag: tip
64 parent: 4:adf1a74a7f7b
74 parent: 4:adf1a74a7f7b
65 parent: 3:1c28f494dae6
75 parent: 3:1c28f494dae6
66 user: test
76 user: test
67 date: Thu Jan 01 00:00:00 1970 +0000
77 date: Thu Jan 01 00:00:00 1970 +0000
68 summary: merge
78 summary: merge
69
79
70 changeset: 4:adf1a74a7f7b
80 changeset: 4:adf1a74a7f7b
71 branch: foo
81 branch: foo
72 parent: 1:6c0e42da283a
82 parent: 1:6c0e42da283a
73 user: test
83 user: test
74 date: Thu Jan 01 00:00:00 1970 +0000
84 date: Thu Jan 01 00:00:00 1970 +0000
75 summary: modify a branch
85 summary: modify a branch
76
86
77 changeset: 3:1c28f494dae6
87 changeset: 3:1c28f494dae6
78 user: test
88 user: test
79 date: Thu Jan 01 00:00:00 1970 +0000
89 date: Thu Jan 01 00:00:00 1970 +0000
80 summary: clear branch name
90 summary: clear branch name
81
91
82 changeset: 2:c21617b13b22
92 changeset: 2:c21617b13b22
83 branch: bar
93 branch: bar
84 user: test
94 user: test
85 date: Thu Jan 01 00:00:00 1970 +0000
95 date: Thu Jan 01 00:00:00 1970 +0000
86 summary: change branch name
96 summary: change branch name
87
97
88 changeset: 1:6c0e42da283a
98 changeset: 1:6c0e42da283a
89 branch: foo
99 branch: foo
90 user: test
100 user: test
91 date: Thu Jan 01 00:00:00 1970 +0000
101 date: Thu Jan 01 00:00:00 1970 +0000
92 summary: add branch name
102 summary: add branch name
93
103
94 changeset: 0:db01e8ea3388
104 changeset: 0:db01e8ea3388
95 user: test
105 user: test
96 date: Thu Jan 01 00:00:00 1970 +0000
106 date: Thu Jan 01 00:00:00 1970 +0000
97 summary: initial
107 summary: initial
98
108
99 $ hg branches
109 $ hg branches
100 foo 5:530046499edf
110 foo 5:530046499edf
101 default 3:1c28f494dae6 (inactive)
111 default 3:1c28f494dae6 (inactive)
102 bar 2:c21617b13b22 (inactive)
112 bar 2:c21617b13b22 (inactive)
103
113
104 $ hg branches -q
114 $ hg branches -q
105 foo
115 foo
106 default
116 default
107 bar
117 bar
108
118
109 Test for invalid branch cache:
119 Test for invalid branch cache:
110
120
111 $ hg rollback
121 $ hg rollback
112 repository tip rolled back to revision 4 (undo commit)
122 repository tip rolled back to revision 4 (undo commit)
113 working directory now based on revisions 4 and 3
123 working directory now based on revisions 4 and 3
114
124
115 $ cp $branchcache .hg/bc-invalid
125 $ cp ${branchcache}-unserved .hg/bc-invalid
116
126
117 $ hg log -r foo
127 $ hg log -r foo
118 changeset: 4:adf1a74a7f7b
128 changeset: 4:adf1a74a7f7b
119 branch: foo
129 branch: foo
120 tag: tip
130 tag: tip
121 parent: 1:6c0e42da283a
131 parent: 1:6c0e42da283a
122 user: test
132 user: test
123 date: Thu Jan 01 00:00:00 1970 +0000
133 date: Thu Jan 01 00:00:00 1970 +0000
124 summary: modify a branch
134 summary: modify a branch
125
135
126 $ cp .hg/bc-invalid $branchcache
136 $ cp .hg/bc-invalid $branchcache
127
137
128 $ hg --debug log -r foo
138 $ hg --debug log -r foo
129 invalid branchheads cache: tip differs
139 invalid branchheads cache: tip differs
130 changeset: 4:adf1a74a7f7b4cd193d12992f5d0d6a004ed21d6
140 changeset: 4:adf1a74a7f7b4cd193d12992f5d0d6a004ed21d6
131 branch: foo
141 branch: foo
132 tag: tip
142 tag: tip
133 phase: draft
143 phase: draft
134 parent: 1:6c0e42da283a56b5edc5b4fadb491365ec7f5fa8
144 parent: 1:6c0e42da283a56b5edc5b4fadb491365ec7f5fa8
135 parent: -1:0000000000000000000000000000000000000000
145 parent: -1:0000000000000000000000000000000000000000
136 manifest: 1:8c342a37dfba0b3d3ce073562a00d8a813c54ffe
146 manifest: 1:8c342a37dfba0b3d3ce073562a00d8a813c54ffe
137 user: test
147 user: test
138 date: Thu Jan 01 00:00:00 1970 +0000
148 date: Thu Jan 01 00:00:00 1970 +0000
139 files: a
149 files: a
140 extra: branch=foo
150 extra: branch=foo
141 description:
151 description:
142 modify a branch
152 modify a branch
143
153
144
154
145 $ rm $branchcache
155 $ purgebranchcaches
146 $ echo corrupted > $branchcache
156 $ echo corrupted > $branchcache
147
157
148 $ hg log -qr foo
158 $ hg log -qr foo
149 4:adf1a74a7f7b
159 4:adf1a74a7f7b
150
160
151 $ cat $branchcache
161 $ listbranchcaches
162 === .hg/cache/branchheads ===
163 corrupted
164 === .hg/cache/branchheads-unserved ===
152 adf1a74a7f7b4cd193d12992f5d0d6a004ed21d6 4
165 adf1a74a7f7b4cd193d12992f5d0d6a004ed21d6 4
153 1c28f494dae69a2f8fc815059d257eccf3fcfe75 default
166 1c28f494dae69a2f8fc815059d257eccf3fcfe75 default
154 adf1a74a7f7b4cd193d12992f5d0d6a004ed21d6 foo
167 adf1a74a7f7b4cd193d12992f5d0d6a004ed21d6 foo
155 c21617b13b220988e7a2e26290fbe4325ffa7139 bar
168 c21617b13b220988e7a2e26290fbe4325ffa7139 bar
156
169
157 Push should update the branch cache:
170 Push should update the branch cache:
158
171
159 $ hg init ../target
172 $ hg init ../target
160
173
161 Pushing just rev 0:
174 Pushing just rev 0:
162
175
163 $ hg push -qr 0 ../target
176 $ hg push -qr 0 ../target
164
177
165 $ cat ../target/$branchcache
178 $ (cd ../target/; listbranchcaches)
179 === .hg/cache/branchheads-unserved ===
166 db01e8ea3388fd3c7c94e1436ea2bd6a53d581c5 0
180 db01e8ea3388fd3c7c94e1436ea2bd6a53d581c5 0
167 db01e8ea3388fd3c7c94e1436ea2bd6a53d581c5 default
181 db01e8ea3388fd3c7c94e1436ea2bd6a53d581c5 default
168
182
169 Pushing everything:
183 Pushing everything:
170
184
171 $ hg push -qf ../target
185 $ hg push -qf ../target
172
186
173 $ cat ../target/$branchcache
187 $ (cd ../target/; listbranchcaches)
188 === .hg/cache/branchheads-unserved ===
174 adf1a74a7f7b4cd193d12992f5d0d6a004ed21d6 4
189 adf1a74a7f7b4cd193d12992f5d0d6a004ed21d6 4
175 1c28f494dae69a2f8fc815059d257eccf3fcfe75 default
190 1c28f494dae69a2f8fc815059d257eccf3fcfe75 default
176 adf1a74a7f7b4cd193d12992f5d0d6a004ed21d6 foo
191 adf1a74a7f7b4cd193d12992f5d0d6a004ed21d6 foo
177 c21617b13b220988e7a2e26290fbe4325ffa7139 bar
192 c21617b13b220988e7a2e26290fbe4325ffa7139 bar
178
193
179 Update with no arguments: tipmost revision of the current branch:
194 Update with no arguments: tipmost revision of the current branch:
180
195
181 $ hg up -q -C 0
196 $ hg up -q -C 0
182 $ hg up -q
197 $ hg up -q
183 $ hg id
198 $ hg id
184 1c28f494dae6
199 1c28f494dae6
185
200
186 $ hg up -q 1
201 $ hg up -q 1
187 $ hg up -q
202 $ hg up -q
188 $ hg id
203 $ hg id
189 adf1a74a7f7b (foo) tip
204 adf1a74a7f7b (foo) tip
190
205
191 $ hg branch foobar
206 $ hg branch foobar
192 marked working directory as branch foobar
207 marked working directory as branch foobar
193 (branches are permanent and global, did you want a bookmark?)
208 (branches are permanent and global, did you want a bookmark?)
194
209
195 $ hg up
210 $ hg up
196 abort: branch foobar not found
211 abort: branch foobar not found
197 [255]
212 [255]
198
213
199 Fastforward merge:
214 Fastforward merge:
200
215
201 $ hg branch ff
216 $ hg branch ff
202 marked working directory as branch ff
217 marked working directory as branch ff
203 (branches are permanent and global, did you want a bookmark?)
218 (branches are permanent and global, did you want a bookmark?)
204
219
205 $ echo ff > ff
220 $ echo ff > ff
206 $ hg ci -Am'fast forward'
221 $ hg ci -Am'fast forward'
207 adding ff
222 adding ff
208
223
209 $ hg up foo
224 $ hg up foo
210 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
225 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
211
226
212 $ hg merge ff
227 $ hg merge ff
213 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
228 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
214 (branch merge, don't forget to commit)
229 (branch merge, don't forget to commit)
215
230
216 $ hg branch
231 $ hg branch
217 foo
232 foo
218 $ hg commit -m'Merge ff into foo'
233 $ hg commit -m'Merge ff into foo'
219 $ hg parents
234 $ hg parents
220 changeset: 6:185ffbfefa30
235 changeset: 6:185ffbfefa30
221 branch: foo
236 branch: foo
222 tag: tip
237 tag: tip
223 parent: 4:adf1a74a7f7b
238 parent: 4:adf1a74a7f7b
224 parent: 5:1a3c27dc5e11
239 parent: 5:1a3c27dc5e11
225 user: test
240 user: test
226 date: Thu Jan 01 00:00:00 1970 +0000
241 date: Thu Jan 01 00:00:00 1970 +0000
227 summary: Merge ff into foo
242 summary: Merge ff into foo
228
243
229 $ hg manifest
244 $ hg manifest
230 a
245 a
231 ff
246 ff
232
247
233
248
234 Test merging, add 3 default heads and one test head:
249 Test merging, add 3 default heads and one test head:
235
250
236 $ cd ..
251 $ cd ..
237 $ hg init merges
252 $ hg init merges
238 $ cd merges
253 $ cd merges
239 $ echo a > a
254 $ echo a > a
240 $ hg ci -Ama
255 $ hg ci -Ama
241 adding a
256 adding a
242
257
243 $ echo b > b
258 $ echo b > b
244 $ hg ci -Amb
259 $ hg ci -Amb
245 adding b
260 adding b
246
261
247 $ hg up 0
262 $ hg up 0
248 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
263 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
249 $ echo c > c
264 $ echo c > c
250 $ hg ci -Amc
265 $ hg ci -Amc
251 adding c
266 adding c
252 created new head
267 created new head
253
268
254 $ hg up 0
269 $ hg up 0
255 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
270 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
256 $ echo d > d
271 $ echo d > d
257 $ hg ci -Amd
272 $ hg ci -Amd
258 adding d
273 adding d
259 created new head
274 created new head
260
275
261 $ hg up 0
276 $ hg up 0
262 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
277 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
263 $ hg branch test
278 $ hg branch test
264 marked working directory as branch test
279 marked working directory as branch test
265 (branches are permanent and global, did you want a bookmark?)
280 (branches are permanent and global, did you want a bookmark?)
266 $ echo e >> e
281 $ echo e >> e
267 $ hg ci -Ame
282 $ hg ci -Ame
268 adding e
283 adding e
269
284
270 $ hg log
285 $ hg log
271 changeset: 4:3a1e01ed1df4
286 changeset: 4:3a1e01ed1df4
272 branch: test
287 branch: test
273 tag: tip
288 tag: tip
274 parent: 0:cb9a9f314b8b
289 parent: 0:cb9a9f314b8b
275 user: test
290 user: test
276 date: Thu Jan 01 00:00:00 1970 +0000
291 date: Thu Jan 01 00:00:00 1970 +0000
277 summary: e
292 summary: e
278
293
279 changeset: 3:980f7dc84c29
294 changeset: 3:980f7dc84c29
280 parent: 0:cb9a9f314b8b
295 parent: 0:cb9a9f314b8b
281 user: test
296 user: test
282 date: Thu Jan 01 00:00:00 1970 +0000
297 date: Thu Jan 01 00:00:00 1970 +0000
283 summary: d
298 summary: d
284
299
285 changeset: 2:d36c0562f908
300 changeset: 2:d36c0562f908
286 parent: 0:cb9a9f314b8b
301 parent: 0:cb9a9f314b8b
287 user: test
302 user: test
288 date: Thu Jan 01 00:00:00 1970 +0000
303 date: Thu Jan 01 00:00:00 1970 +0000
289 summary: c
304 summary: c
290
305
291 changeset: 1:d2ae7f538514
306 changeset: 1:d2ae7f538514
292 user: test
307 user: test
293 date: Thu Jan 01 00:00:00 1970 +0000
308 date: Thu Jan 01 00:00:00 1970 +0000
294 summary: b
309 summary: b
295
310
296 changeset: 0:cb9a9f314b8b
311 changeset: 0:cb9a9f314b8b
297 user: test
312 user: test
298 date: Thu Jan 01 00:00:00 1970 +0000
313 date: Thu Jan 01 00:00:00 1970 +0000
299 summary: a
314 summary: a
300
315
301 Implicit merge with test branch as parent:
316 Implicit merge with test branch as parent:
302
317
303 $ hg merge
318 $ hg merge
304 abort: branch 'test' has one head - please merge with an explicit rev
319 abort: branch 'test' has one head - please merge with an explicit rev
305 (run 'hg heads' to see all heads)
320 (run 'hg heads' to see all heads)
306 [255]
321 [255]
307 $ hg up -C default
322 $ hg up -C default
308 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
323 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
309
324
310 Implicit merge with default branch as parent:
325 Implicit merge with default branch as parent:
311
326
312 $ hg merge
327 $ hg merge
313 abort: branch 'default' has 3 heads - please merge with an explicit rev
328 abort: branch 'default' has 3 heads - please merge with an explicit rev
314 (run 'hg heads .' to see heads)
329 (run 'hg heads .' to see heads)
315 [255]
330 [255]
316
331
317 3 branch heads, explicit merge required:
332 3 branch heads, explicit merge required:
318
333
319 $ hg merge 2
334 $ hg merge 2
320 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
335 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
321 (branch merge, don't forget to commit)
336 (branch merge, don't forget to commit)
322 $ hg ci -m merge
337 $ hg ci -m merge
323
338
324 2 branch heads, implicit merge works:
339 2 branch heads, implicit merge works:
325
340
326 $ hg merge
341 $ hg merge
327 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
342 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
328 (branch merge, don't forget to commit)
343 (branch merge, don't forget to commit)
329
344
330 $ cd ..
345 $ cd ..
@@ -1,441 +1,447 b''
1 Test file dedicated to testing the divergent troubles from obsolete changeset.
1 Test file dedicated to testing the divergent troubles from obsolete changeset.
2
2
3 This is the most complexe troubles from far so we isolate it in a dedicated
3 This is the most complexe troubles from far so we isolate it in a dedicated
4 file.
4 file.
5
5
6 Enable obsolete
6 Enable obsolete
7
7
8 $ cat > obs.py << EOF
8 $ cat > obs.py << EOF
9 > import mercurial.obsolete
9 > import mercurial.obsolete
10 > mercurial.obsolete._enabled = True
10 > mercurial.obsolete._enabled = True
11 > EOF
11 > EOF
12 $ cat >> $HGRCPATH << EOF
12 $ cat >> $HGRCPATH << EOF
13 > [ui]
13 > [ui]
14 > logtemplate = {rev}:{node|short} {desc}\n
14 > logtemplate = {rev}:{node|short} {desc}\n
15 > [extensions]
15 > [extensions]
16 > obs=${TESTTMP}/obs.py
16 > obs=${TESTTMP}/obs.py
17 > [alias]
17 > [alias]
18 > debugobsolete = debugobsolete -d '0 0'
18 > debugobsolete = debugobsolete -d '0 0'
19 > [phases]
19 > [phases]
20 > publish=False
20 > publish=False
21 > EOF
21 > EOF
22
22
23
23
24 $ mkcommit() {
24 $ mkcommit() {
25 > echo "$1" > "$1"
25 > echo "$1" > "$1"
26 > hg add "$1"
26 > hg add "$1"
27 > hg ci -m "$1"
27 > hg ci -m "$1"
28 > }
28 > }
29 $ getid() {
29 $ getid() {
30 > hg id --debug -ir "desc('$1')"
30 > hg id --debug -ir "desc('$1')"
31 > }
31 > }
32
32
33 setup repo
33 setup repo
34
34
35 $ hg init reference
35 $ hg init reference
36 $ cd reference
36 $ cd reference
37 $ mkcommit base
37 $ mkcommit base
38 $ mkcommit A_0
38 $ mkcommit A_0
39 $ hg up 0
39 $ hg up 0
40 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
40 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
41 $ mkcommit A_1
41 $ mkcommit A_1
42 created new head
42 created new head
43 $ hg up 0
43 $ hg up 0
44 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
44 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
45 $ mkcommit A_2
45 $ mkcommit A_2
46 created new head
46 created new head
47 $ hg up 0
47 $ hg up 0
48 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
48 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
49 $ cd ..
49 $ cd ..
50
50
51
51
52 $ newcase() {
52 $ newcase() {
53 > hg clone -u 0 -q reference $1
53 > hg clone -u 0 -q reference $1
54 > cd $1
54 > cd $1
55 > }
55 > }
56
56
57 direct divergence
57 direct divergence
58 -----------------
58 -----------------
59
59
60 A_1 have two direct and divergent successors A_1 and A_1
60 A_1 have two direct and divergent successors A_1 and A_1
61
61
62 $ newcase direct
62 $ newcase direct
63 $ hg debugobsolete `getid A_0` `getid A_1`
63 $ hg debugobsolete `getid A_0` `getid A_1`
64 $ hg debugobsolete `getid A_0` `getid A_2`
64 $ hg debugobsolete `getid A_0` `getid A_2`
65 invalid branchheads cache (unserved): tip differs
65 $ hg log -G --hidden
66 $ hg log -G --hidden
66 o 3:392fd25390da A_2
67 o 3:392fd25390da A_2
67 |
68 |
68 | o 2:82623d38b9ba A_1
69 | o 2:82623d38b9ba A_1
69 |/
70 |/
70 | x 1:007dc284c1f8 A_0
71 | x 1:007dc284c1f8 A_0
71 |/
72 |/
72 @ 0:d20a80d4def3 base
73 @ 0:d20a80d4def3 base
73
74
74 $ hg debugsuccessorssets 'all()'
75 $ hg debugsuccessorssets 'all()'
75 d20a80d4def3
76 d20a80d4def3
76 d20a80d4def3
77 d20a80d4def3
77 007dc284c1f8
78 007dc284c1f8
78 392fd25390da
79 392fd25390da
79 82623d38b9ba
80 82623d38b9ba
80 82623d38b9ba
81 82623d38b9ba
81 82623d38b9ba
82 82623d38b9ba
82 392fd25390da
83 392fd25390da
83 392fd25390da
84 392fd25390da
84 $ hg log -r 'divergent()'
85 $ hg log -r 'divergent()'
85 2:82623d38b9ba A_1
86 2:82623d38b9ba A_1
86 3:392fd25390da A_2
87 3:392fd25390da A_2
87
88
88 check that mercurial refuse to push
89 check that mercurial refuse to push
89
90
90 $ hg init ../other
91 $ hg init ../other
91 $ hg push ../other
92 $ hg push ../other
92 pushing to ../other
93 pushing to ../other
93 searching for changes
94 searching for changes
94 abort: push includes divergent changeset: 392fd25390da!
95 abort: push includes divergent changeset: 392fd25390da!
95 [255]
96 [255]
96
97
97 $ cd ..
98 $ cd ..
98
99
99
100
100 indirect divergence with known changeset
101 indirect divergence with known changeset
101 -------------------------------------------
102 -------------------------------------------
102
103
103 $ newcase indirect_known
104 $ newcase indirect_known
104 $ hg debugobsolete `getid A_0` `getid A_1`
105 $ hg debugobsolete `getid A_0` `getid A_1`
105 $ hg debugobsolete `getid A_0` `getid A_2`
106 $ hg debugobsolete `getid A_0` `getid A_2`
107 invalid branchheads cache (unserved): tip differs
106 $ mkcommit A_3
108 $ mkcommit A_3
107 created new head
109 created new head
108 $ hg debugobsolete `getid A_2` `getid A_3`
110 $ hg debugobsolete `getid A_2` `getid A_3`
109 $ hg log -G --hidden
111 $ hg log -G --hidden
110 @ 4:01f36c5a8fda A_3
112 @ 4:01f36c5a8fda A_3
111 |
113 |
112 | x 3:392fd25390da A_2
114 | x 3:392fd25390da A_2
113 |/
115 |/
114 | o 2:82623d38b9ba A_1
116 | o 2:82623d38b9ba A_1
115 |/
117 |/
116 | x 1:007dc284c1f8 A_0
118 | x 1:007dc284c1f8 A_0
117 |/
119 |/
118 o 0:d20a80d4def3 base
120 o 0:d20a80d4def3 base
119
121
120 $ hg debugsuccessorssets 'all()'
122 $ hg debugsuccessorssets 'all()'
121 d20a80d4def3
123 d20a80d4def3
122 d20a80d4def3
124 d20a80d4def3
123 007dc284c1f8
125 007dc284c1f8
124 01f36c5a8fda
126 01f36c5a8fda
125 82623d38b9ba
127 82623d38b9ba
126 82623d38b9ba
128 82623d38b9ba
127 82623d38b9ba
129 82623d38b9ba
128 392fd25390da
130 392fd25390da
129 01f36c5a8fda
131 01f36c5a8fda
130 01f36c5a8fda
132 01f36c5a8fda
131 01f36c5a8fda
133 01f36c5a8fda
132 $ hg log -r 'divergent()'
134 $ hg log -r 'divergent()'
133 2:82623d38b9ba A_1
135 2:82623d38b9ba A_1
134 4:01f36c5a8fda A_3
136 4:01f36c5a8fda A_3
135 $ cd ..
137 $ cd ..
136
138
137
139
138 indirect divergence with known changeset
140 indirect divergence with known changeset
139 -------------------------------------------
141 -------------------------------------------
140
142
141 $ newcase indirect_unknown
143 $ newcase indirect_unknown
142 $ hg debugobsolete `getid A_0` aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
144 $ hg debugobsolete `getid A_0` aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
143 $ hg debugobsolete aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa `getid A_1`
145 $ hg debugobsolete aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa `getid A_1`
146 invalid branchheads cache (unserved): tip differs
144 $ hg debugobsolete `getid A_0` `getid A_2`
147 $ hg debugobsolete `getid A_0` `getid A_2`
145 $ hg log -G --hidden
148 $ hg log -G --hidden
146 o 3:392fd25390da A_2
149 o 3:392fd25390da A_2
147 |
150 |
148 | o 2:82623d38b9ba A_1
151 | o 2:82623d38b9ba A_1
149 |/
152 |/
150 | x 1:007dc284c1f8 A_0
153 | x 1:007dc284c1f8 A_0
151 |/
154 |/
152 @ 0:d20a80d4def3 base
155 @ 0:d20a80d4def3 base
153
156
154 $ hg debugsuccessorssets 'all()'
157 $ hg debugsuccessorssets 'all()'
155 d20a80d4def3
158 d20a80d4def3
156 d20a80d4def3
159 d20a80d4def3
157 007dc284c1f8
160 007dc284c1f8
158 392fd25390da
161 392fd25390da
159 82623d38b9ba
162 82623d38b9ba
160 82623d38b9ba
163 82623d38b9ba
161 82623d38b9ba
164 82623d38b9ba
162 392fd25390da
165 392fd25390da
163 392fd25390da
166 392fd25390da
164 $ hg log -r 'divergent()'
167 $ hg log -r 'divergent()'
165 2:82623d38b9ba A_1
168 2:82623d38b9ba A_1
166 3:392fd25390da A_2
169 3:392fd25390da A_2
167 $ cd ..
170 $ cd ..
168
171
169 do not take unknown node in account if they are final
172 do not take unknown node in account if they are final
170 -----------------------------------------------------
173 -----------------------------------------------------
171
174
172 $ newcase final-unknown
175 $ newcase final-unknown
173 $ hg debugobsolete `getid A_0` `getid A_1`
176 $ hg debugobsolete `getid A_0` `getid A_1`
174 $ hg debugobsolete `getid A_1` `getid A_2`
177 $ hg debugobsolete `getid A_1` `getid A_2`
178 invalid branchheads cache (unserved): tip differs
175 $ hg debugobsolete `getid A_0` bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
179 $ hg debugobsolete `getid A_0` bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
176 $ hg debugobsolete bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb cccccccccccccccccccccccccccccccccccccccc
180 $ hg debugobsolete bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb cccccccccccccccccccccccccccccccccccccccc
177 $ hg debugobsolete `getid A_1` dddddddddddddddddddddddddddddddddddddddd
181 $ hg debugobsolete `getid A_1` dddddddddddddddddddddddddddddddddddddddd
178
182
179 $ hg debugsuccessorssets 'desc('A_0')'
183 $ hg debugsuccessorssets 'desc('A_0')'
180 007dc284c1f8
184 007dc284c1f8
181 392fd25390da
185 392fd25390da
182
186
183 $ cd ..
187 $ cd ..
184
188
185 divergence that converge again is not divergence anymore
189 divergence that converge again is not divergence anymore
186 -----------------------------------------------------
190 -----------------------------------------------------
187
191
188 $ newcase converged_divergence
192 $ newcase converged_divergence
189 $ hg debugobsolete `getid A_0` `getid A_1`
193 $ hg debugobsolete `getid A_0` `getid A_1`
190 $ hg debugobsolete `getid A_0` `getid A_2`
194 $ hg debugobsolete `getid A_0` `getid A_2`
195 invalid branchheads cache (unserved): tip differs
191 $ mkcommit A_3
196 $ mkcommit A_3
192 created new head
197 created new head
193 $ hg debugobsolete `getid A_1` `getid A_3`
198 $ hg debugobsolete `getid A_1` `getid A_3`
194 $ hg debugobsolete `getid A_2` `getid A_3`
199 $ hg debugobsolete `getid A_2` `getid A_3`
195 $ hg log -G --hidden
200 $ hg log -G --hidden
196 @ 4:01f36c5a8fda A_3
201 @ 4:01f36c5a8fda A_3
197 |
202 |
198 | x 3:392fd25390da A_2
203 | x 3:392fd25390da A_2
199 |/
204 |/
200 | x 2:82623d38b9ba A_1
205 | x 2:82623d38b9ba A_1
201 |/
206 |/
202 | x 1:007dc284c1f8 A_0
207 | x 1:007dc284c1f8 A_0
203 |/
208 |/
204 o 0:d20a80d4def3 base
209 o 0:d20a80d4def3 base
205
210
206 $ hg debugsuccessorssets 'all()'
211 $ hg debugsuccessorssets 'all()'
207 d20a80d4def3
212 d20a80d4def3
208 d20a80d4def3
213 d20a80d4def3
209 007dc284c1f8
214 007dc284c1f8
210 01f36c5a8fda
215 01f36c5a8fda
211 82623d38b9ba
216 82623d38b9ba
212 01f36c5a8fda
217 01f36c5a8fda
213 392fd25390da
218 392fd25390da
214 01f36c5a8fda
219 01f36c5a8fda
215 01f36c5a8fda
220 01f36c5a8fda
216 01f36c5a8fda
221 01f36c5a8fda
217 $ hg log -r 'divergent()'
222 $ hg log -r 'divergent()'
218 $ cd ..
223 $ cd ..
219
224
220 split is not divergences
225 split is not divergences
221 -----------------------------
226 -----------------------------
222
227
223 $ newcase split
228 $ newcase split
224 $ hg debugobsolete `getid A_0` `getid A_1` `getid A_2`
229 $ hg debugobsolete `getid A_0` `getid A_1` `getid A_2`
225 $ hg log -G --hidden
230 $ hg log -G --hidden
226 o 3:392fd25390da A_2
231 o 3:392fd25390da A_2
227 |
232 |
228 | o 2:82623d38b9ba A_1
233 | o 2:82623d38b9ba A_1
229 |/
234 |/
230 | x 1:007dc284c1f8 A_0
235 | x 1:007dc284c1f8 A_0
231 |/
236 |/
232 @ 0:d20a80d4def3 base
237 @ 0:d20a80d4def3 base
233
238
234 $ hg debugsuccessorssets 'all()'
239 $ hg debugsuccessorssets 'all()'
235 d20a80d4def3
240 d20a80d4def3
236 d20a80d4def3
241 d20a80d4def3
237 007dc284c1f8
242 007dc284c1f8
238 82623d38b9ba 392fd25390da
243 82623d38b9ba 392fd25390da
239 82623d38b9ba
244 82623d38b9ba
240 82623d38b9ba
245 82623d38b9ba
241 392fd25390da
246 392fd25390da
242 392fd25390da
247 392fd25390da
243 $ hg log -r 'divergent()'
248 $ hg log -r 'divergent()'
244
249
245 Even when subsequente rewriting happen
250 Even when subsequente rewriting happen
246
251
247 $ mkcommit A_3
252 $ mkcommit A_3
248 created new head
253 created new head
249 $ hg debugobsolete `getid A_1` `getid A_3`
254 $ hg debugobsolete `getid A_1` `getid A_3`
250 $ hg up 0
255 $ hg up 0
251 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
256 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
252 $ mkcommit A_4
257 $ mkcommit A_4
253 created new head
258 created new head
254 $ hg debugobsolete `getid A_2` `getid A_4`
259 $ hg debugobsolete `getid A_2` `getid A_4`
255 $ hg up 0
260 $ hg up 0
256 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
261 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
257 $ mkcommit A_5
262 $ mkcommit A_5
258 created new head
263 created new head
259 $ hg debugobsolete `getid A_4` `getid A_5`
264 $ hg debugobsolete `getid A_4` `getid A_5`
260 $ hg log -G --hidden
265 $ hg log -G --hidden
261 @ 6:e442cfc57690 A_5
266 @ 6:e442cfc57690 A_5
262 |
267 |
263 | x 5:6a411f0d7a0a A_4
268 | x 5:6a411f0d7a0a A_4
264 |/
269 |/
265 | o 4:01f36c5a8fda A_3
270 | o 4:01f36c5a8fda A_3
266 |/
271 |/
267 | x 3:392fd25390da A_2
272 | x 3:392fd25390da A_2
268 |/
273 |/
269 | x 2:82623d38b9ba A_1
274 | x 2:82623d38b9ba A_1
270 |/
275 |/
271 | x 1:007dc284c1f8 A_0
276 | x 1:007dc284c1f8 A_0
272 |/
277 |/
273 o 0:d20a80d4def3 base
278 o 0:d20a80d4def3 base
274
279
275 $ hg debugsuccessorssets 'all()'
280 $ hg debugsuccessorssets 'all()'
276 d20a80d4def3
281 d20a80d4def3
277 d20a80d4def3
282 d20a80d4def3
278 007dc284c1f8
283 007dc284c1f8
279 01f36c5a8fda e442cfc57690
284 01f36c5a8fda e442cfc57690
280 82623d38b9ba
285 82623d38b9ba
281 01f36c5a8fda
286 01f36c5a8fda
282 392fd25390da
287 392fd25390da
283 e442cfc57690
288 e442cfc57690
284 01f36c5a8fda
289 01f36c5a8fda
285 01f36c5a8fda
290 01f36c5a8fda
286 6a411f0d7a0a
291 6a411f0d7a0a
287 e442cfc57690
292 e442cfc57690
288 e442cfc57690
293 e442cfc57690
289 e442cfc57690
294 e442cfc57690
290 $ hg log -r 'divergent()'
295 $ hg log -r 'divergent()'
291
296
292 Check more complexe obsolescence graft (with divergence)
297 Check more complexe obsolescence graft (with divergence)
293
298
294 $ mkcommit B_0; hg up 0
299 $ mkcommit B_0; hg up 0
295 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
300 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
296 $ hg debugobsolete `getid B_0` `getid A_2`
301 $ hg debugobsolete `getid B_0` `getid A_2`
297 $ mkcommit A_7; hg up 0
302 $ mkcommit A_7; hg up 0
298 created new head
303 created new head
299 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
304 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
300 $ mkcommit A_8; hg up 0
305 $ mkcommit A_8; hg up 0
301 created new head
306 created new head
302 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
307 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
303 $ hg debugobsolete `getid A_5` `getid A_7` `getid A_8`
308 $ hg debugobsolete `getid A_5` `getid A_7` `getid A_8`
304 $ mkcommit A_9; hg up 0
309 $ mkcommit A_9; hg up 0
305 created new head
310 created new head
306 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
311 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
307 $ hg debugobsolete `getid A_5` `getid A_9`
312 $ hg debugobsolete `getid A_5` `getid A_9`
308 $ hg log -G --hidden
313 $ hg log -G --hidden
309 o 10:bed64f5d2f5a A_9
314 o 10:bed64f5d2f5a A_9
310 |
315 |
311 | o 9:14608b260df8 A_8
316 | o 9:14608b260df8 A_8
312 |/
317 |/
313 | o 8:7ae126973a96 A_7
318 | o 8:7ae126973a96 A_7
314 |/
319 |/
315 | x 7:3750ebee865d B_0
320 | x 7:3750ebee865d B_0
316 | |
321 | |
317 | x 6:e442cfc57690 A_5
322 | x 6:e442cfc57690 A_5
318 |/
323 |/
319 | x 5:6a411f0d7a0a A_4
324 | x 5:6a411f0d7a0a A_4
320 |/
325 |/
321 | o 4:01f36c5a8fda A_3
326 | o 4:01f36c5a8fda A_3
322 |/
327 |/
323 | x 3:392fd25390da A_2
328 | x 3:392fd25390da A_2
324 |/
329 |/
325 | x 2:82623d38b9ba A_1
330 | x 2:82623d38b9ba A_1
326 |/
331 |/
327 | x 1:007dc284c1f8 A_0
332 | x 1:007dc284c1f8 A_0
328 |/
333 |/
329 @ 0:d20a80d4def3 base
334 @ 0:d20a80d4def3 base
330
335
331 $ hg debugsuccessorssets 'all()'
336 $ hg debugsuccessorssets 'all()'
332 d20a80d4def3
337 d20a80d4def3
333 d20a80d4def3
338 d20a80d4def3
334 007dc284c1f8
339 007dc284c1f8
335 01f36c5a8fda bed64f5d2f5a
340 01f36c5a8fda bed64f5d2f5a
336 01f36c5a8fda 7ae126973a96 14608b260df8
341 01f36c5a8fda 7ae126973a96 14608b260df8
337 82623d38b9ba
342 82623d38b9ba
338 01f36c5a8fda
343 01f36c5a8fda
339 392fd25390da
344 392fd25390da
340 bed64f5d2f5a
345 bed64f5d2f5a
341 7ae126973a96 14608b260df8
346 7ae126973a96 14608b260df8
342 01f36c5a8fda
347 01f36c5a8fda
343 01f36c5a8fda
348 01f36c5a8fda
344 6a411f0d7a0a
349 6a411f0d7a0a
345 bed64f5d2f5a
350 bed64f5d2f5a
346 7ae126973a96 14608b260df8
351 7ae126973a96 14608b260df8
347 e442cfc57690
352 e442cfc57690
348 bed64f5d2f5a
353 bed64f5d2f5a
349 7ae126973a96 14608b260df8
354 7ae126973a96 14608b260df8
350 3750ebee865d
355 3750ebee865d
351 bed64f5d2f5a
356 bed64f5d2f5a
352 7ae126973a96 14608b260df8
357 7ae126973a96 14608b260df8
353 7ae126973a96
358 7ae126973a96
354 7ae126973a96
359 7ae126973a96
355 14608b260df8
360 14608b260df8
356 14608b260df8
361 14608b260df8
357 bed64f5d2f5a
362 bed64f5d2f5a
358 bed64f5d2f5a
363 bed64f5d2f5a
359 $ hg log -r 'divergent()'
364 $ hg log -r 'divergent()'
360 4:01f36c5a8fda A_3
365 4:01f36c5a8fda A_3
361 8:7ae126973a96 A_7
366 8:7ae126973a96 A_7
362 9:14608b260df8 A_8
367 9:14608b260df8 A_8
363 10:bed64f5d2f5a A_9
368 10:bed64f5d2f5a A_9
364
369
365 fix the divergence
370 fix the divergence
366
371
367 $ mkcommit A_A; hg up 0
372 $ mkcommit A_A; hg up 0
368 created new head
373 created new head
369 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
374 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
370 $ hg debugobsolete `getid A_9` `getid A_A`
375 $ hg debugobsolete `getid A_9` `getid A_A`
371 $ hg debugobsolete `getid A_7` `getid A_A`
376 $ hg debugobsolete `getid A_7` `getid A_A`
372 $ hg debugobsolete `getid A_8` `getid A_A`
377 $ hg debugobsolete `getid A_8` `getid A_A`
373 $ hg log -G --hidden
378 $ hg log -G --hidden
374 o 11:a139f71be9da A_A
379 o 11:a139f71be9da A_A
375 |
380 |
376 | x 10:bed64f5d2f5a A_9
381 | x 10:bed64f5d2f5a A_9
377 |/
382 |/
378 | x 9:14608b260df8 A_8
383 | x 9:14608b260df8 A_8
379 |/
384 |/
380 | x 8:7ae126973a96 A_7
385 | x 8:7ae126973a96 A_7
381 |/
386 |/
382 | x 7:3750ebee865d B_0
387 | x 7:3750ebee865d B_0
383 | |
388 | |
384 | x 6:e442cfc57690 A_5
389 | x 6:e442cfc57690 A_5
385 |/
390 |/
386 | x 5:6a411f0d7a0a A_4
391 | x 5:6a411f0d7a0a A_4
387 |/
392 |/
388 | o 4:01f36c5a8fda A_3
393 | o 4:01f36c5a8fda A_3
389 |/
394 |/
390 | x 3:392fd25390da A_2
395 | x 3:392fd25390da A_2
391 |/
396 |/
392 | x 2:82623d38b9ba A_1
397 | x 2:82623d38b9ba A_1
393 |/
398 |/
394 | x 1:007dc284c1f8 A_0
399 | x 1:007dc284c1f8 A_0
395 |/
400 |/
396 @ 0:d20a80d4def3 base
401 @ 0:d20a80d4def3 base
397
402
398 $ hg debugsuccessorssets 'all()'
403 $ hg debugsuccessorssets 'all()'
399 d20a80d4def3
404 d20a80d4def3
400 d20a80d4def3
405 d20a80d4def3
401 007dc284c1f8
406 007dc284c1f8
402 01f36c5a8fda a139f71be9da
407 01f36c5a8fda a139f71be9da
403 82623d38b9ba
408 82623d38b9ba
404 01f36c5a8fda
409 01f36c5a8fda
405 392fd25390da
410 392fd25390da
406 a139f71be9da
411 a139f71be9da
407 01f36c5a8fda
412 01f36c5a8fda
408 01f36c5a8fda
413 01f36c5a8fda
409 6a411f0d7a0a
414 6a411f0d7a0a
410 a139f71be9da
415 a139f71be9da
411 e442cfc57690
416 e442cfc57690
412 a139f71be9da
417 a139f71be9da
413 3750ebee865d
418 3750ebee865d
414 a139f71be9da
419 a139f71be9da
415 7ae126973a96
420 7ae126973a96
416 a139f71be9da
421 a139f71be9da
417 14608b260df8
422 14608b260df8
418 a139f71be9da
423 a139f71be9da
419 bed64f5d2f5a
424 bed64f5d2f5a
420 a139f71be9da
425 a139f71be9da
421 a139f71be9da
426 a139f71be9da
422 a139f71be9da
427 a139f71be9da
423 $ hg log -r 'divergent()'
428 $ hg log -r 'divergent()'
424
429
425 $ cd ..
430 $ cd ..
426
431
427
432
428 Subset does not diverge
433 Subset does not diverge
429 ------------------------------
434 ------------------------------
430
435
431 Do not report divergent successors-set if it is a subset of another
436 Do not report divergent successors-set if it is a subset of another
432 successors-set. (report [A,B] not [A] + [A,B])
437 successors-set. (report [A,B] not [A] + [A,B])
433
438
434 $ newcase subset
439 $ newcase subset
435 $ hg debugobsolete `getid A_0` `getid A_2`
440 $ hg debugobsolete `getid A_0` `getid A_2`
436 $ hg debugobsolete `getid A_0` `getid A_1` `getid A_2`
441 $ hg debugobsolete `getid A_0` `getid A_1` `getid A_2`
442 invalid branchheads cache (unserved): tip differs
437 $ hg debugsuccessorssets 'desc('A_0')'
443 $ hg debugsuccessorssets 'desc('A_0')'
438 007dc284c1f8
444 007dc284c1f8
439 82623d38b9ba 392fd25390da
445 82623d38b9ba 392fd25390da
440
446
441 $ cd ..
447 $ cd ..
@@ -1,722 +1,722 b''
1 $ cat >> $HGRCPATH <<EOF
1 $ cat >> $HGRCPATH <<EOF
2 > [extensions]
2 > [extensions]
3 > graphlog=
3 > graphlog=
4 > rebase=
4 > rebase=
5 > mq=
5 > mq=
6 >
6 >
7 > [phases]
7 > [phases]
8 > publish=False
8 > publish=False
9 >
9 >
10 > [alias]
10 > [alias]
11 > tglog = log -G --template "{rev}: '{desc}' {branches}\n"
11 > tglog = log -G --template "{rev}: '{desc}' {branches}\n"
12 > tglogp = log -G --template "{rev}:{phase} '{desc}' {branches}\n"
12 > tglogp = log -G --template "{rev}:{phase} '{desc}' {branches}\n"
13 > EOF
13 > EOF
14
14
15 Create repo a:
15 Create repo a:
16
16
17 $ hg init a
17 $ hg init a
18 $ cd a
18 $ cd a
19 $ hg unbundle "$TESTDIR/bundles/rebase.hg"
19 $ hg unbundle "$TESTDIR/bundles/rebase.hg"
20 adding changesets
20 adding changesets
21 adding manifests
21 adding manifests
22 adding file changes
22 adding file changes
23 added 8 changesets with 7 changes to 7 files (+2 heads)
23 added 8 changesets with 7 changes to 7 files (+2 heads)
24 (run 'hg heads' to see heads, 'hg merge' to merge)
24 (run 'hg heads' to see heads, 'hg merge' to merge)
25 $ hg up tip
25 $ hg up tip
26 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
26 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
27
27
28 $ hg tglog
28 $ hg tglog
29 @ 7: 'H'
29 @ 7: 'H'
30 |
30 |
31 | o 6: 'G'
31 | o 6: 'G'
32 |/|
32 |/|
33 o | 5: 'F'
33 o | 5: 'F'
34 | |
34 | |
35 | o 4: 'E'
35 | o 4: 'E'
36 |/
36 |/
37 | o 3: 'D'
37 | o 3: 'D'
38 | |
38 | |
39 | o 2: 'C'
39 | o 2: 'C'
40 | |
40 | |
41 | o 1: 'B'
41 | o 1: 'B'
42 |/
42 |/
43 o 0: 'A'
43 o 0: 'A'
44
44
45 $ cd ..
45 $ cd ..
46
46
47
47
48 Rebasing B onto H and collapsing changesets with different phases:
48 Rebasing B onto H and collapsing changesets with different phases:
49
49
50
50
51 $ hg clone -q -u 3 a a1
51 $ hg clone -q -u 3 a a1
52 $ cd a1
52 $ cd a1
53
53
54 $ hg phase --force --secret 3
54 $ hg phase --force --secret 3
55
55
56 $ hg rebase --collapse --keepbranches
56 $ hg rebase --collapse --keepbranches
57 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob)
57 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob)
58
58
59 $ hg tglogp
59 $ hg tglogp
60 @ 5:secret 'Collapsed revision
60 @ 5:secret 'Collapsed revision
61 | * B
61 | * B
62 | * C
62 | * C
63 | * D'
63 | * D'
64 o 4:draft 'H'
64 o 4:draft 'H'
65 |
65 |
66 | o 3:draft 'G'
66 | o 3:draft 'G'
67 |/|
67 |/|
68 o | 2:draft 'F'
68 o | 2:draft 'F'
69 | |
69 | |
70 | o 1:draft 'E'
70 | o 1:draft 'E'
71 |/
71 |/
72 o 0:draft 'A'
72 o 0:draft 'A'
73
73
74 $ hg manifest
74 $ hg manifest
75 A
75 A
76 B
76 B
77 C
77 C
78 D
78 D
79 F
79 F
80 H
80 H
81
81
82 $ cd ..
82 $ cd ..
83
83
84
84
85 Rebasing E onto H:
85 Rebasing E onto H:
86
86
87 $ hg clone -q -u . a a2
87 $ hg clone -q -u . a a2
88 $ cd a2
88 $ cd a2
89
89
90 $ hg phase --force --secret 6
90 $ hg phase --force --secret 6
91 $ hg rebase --source 4 --collapse
91 $ hg rebase --source 4 --collapse
92 saved backup bundle to $TESTTMP/a2/.hg/strip-backup/*-backup.hg (glob)
92 saved backup bundle to $TESTTMP/a2/.hg/strip-backup/*-backup.hg (glob)
93
93
94 $ hg tglog
94 $ hg tglog
95 @ 6: 'Collapsed revision
95 @ 6: 'Collapsed revision
96 | * E
96 | * E
97 | * G'
97 | * G'
98 o 5: 'H'
98 o 5: 'H'
99 |
99 |
100 o 4: 'F'
100 o 4: 'F'
101 |
101 |
102 | o 3: 'D'
102 | o 3: 'D'
103 | |
103 | |
104 | o 2: 'C'
104 | o 2: 'C'
105 | |
105 | |
106 | o 1: 'B'
106 | o 1: 'B'
107 |/
107 |/
108 o 0: 'A'
108 o 0: 'A'
109
109
110 $ hg manifest
110 $ hg manifest
111 A
111 A
112 E
112 E
113 F
113 F
114 H
114 H
115
115
116 $ cd ..
116 $ cd ..
117
117
118 Rebasing G onto H with custom message:
118 Rebasing G onto H with custom message:
119
119
120 $ hg clone -q -u . a a3
120 $ hg clone -q -u . a a3
121 $ cd a3
121 $ cd a3
122
122
123 $ hg rebase --base 6 -m 'custom message'
123 $ hg rebase --base 6 -m 'custom message'
124 abort: message can only be specified with collapse
124 abort: message can only be specified with collapse
125 [255]
125 [255]
126
126
127 $ hg rebase --source 4 --collapse -m 'custom message'
127 $ hg rebase --source 4 --collapse -m 'custom message'
128 saved backup bundle to $TESTTMP/a3/.hg/strip-backup/*-backup.hg (glob)
128 saved backup bundle to $TESTTMP/a3/.hg/strip-backup/*-backup.hg (glob)
129
129
130 $ hg tglog
130 $ hg tglog
131 @ 6: 'custom message'
131 @ 6: 'custom message'
132 |
132 |
133 o 5: 'H'
133 o 5: 'H'
134 |
134 |
135 o 4: 'F'
135 o 4: 'F'
136 |
136 |
137 | o 3: 'D'
137 | o 3: 'D'
138 | |
138 | |
139 | o 2: 'C'
139 | o 2: 'C'
140 | |
140 | |
141 | o 1: 'B'
141 | o 1: 'B'
142 |/
142 |/
143 o 0: 'A'
143 o 0: 'A'
144
144
145 $ hg manifest
145 $ hg manifest
146 A
146 A
147 E
147 E
148 F
148 F
149 H
149 H
150
150
151 $ cd ..
151 $ cd ..
152
152
153 Create repo b:
153 Create repo b:
154
154
155 $ hg init b
155 $ hg init b
156 $ cd b
156 $ cd b
157
157
158 $ echo A > A
158 $ echo A > A
159 $ hg ci -Am A
159 $ hg ci -Am A
160 adding A
160 adding A
161 $ echo B > B
161 $ echo B > B
162 $ hg ci -Am B
162 $ hg ci -Am B
163 adding B
163 adding B
164
164
165 $ hg up -q 0
165 $ hg up -q 0
166
166
167 $ echo C > C
167 $ echo C > C
168 $ hg ci -Am C
168 $ hg ci -Am C
169 adding C
169 adding C
170 created new head
170 created new head
171
171
172 $ hg merge
172 $ hg merge
173 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
173 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
174 (branch merge, don't forget to commit)
174 (branch merge, don't forget to commit)
175
175
176 $ echo D > D
176 $ echo D > D
177 $ hg ci -Am D
177 $ hg ci -Am D
178 adding D
178 adding D
179
179
180 $ hg up -q 1
180 $ hg up -q 1
181
181
182 $ echo E > E
182 $ echo E > E
183 $ hg ci -Am E
183 $ hg ci -Am E
184 adding E
184 adding E
185 created new head
185 created new head
186
186
187 $ echo F > F
187 $ echo F > F
188 $ hg ci -Am F
188 $ hg ci -Am F
189 adding F
189 adding F
190
190
191 $ hg merge
191 $ hg merge
192 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
192 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
193 (branch merge, don't forget to commit)
193 (branch merge, don't forget to commit)
194 $ hg ci -m G
194 $ hg ci -m G
195
195
196 $ hg up -q 0
196 $ hg up -q 0
197
197
198 $ echo H > H
198 $ echo H > H
199 $ hg ci -Am H
199 $ hg ci -Am H
200 adding H
200 adding H
201 created new head
201 created new head
202
202
203 $ hg tglog
203 $ hg tglog
204 @ 7: 'H'
204 @ 7: 'H'
205 |
205 |
206 | o 6: 'G'
206 | o 6: 'G'
207 | |\
207 | |\
208 | | o 5: 'F'
208 | | o 5: 'F'
209 | | |
209 | | |
210 | | o 4: 'E'
210 | | o 4: 'E'
211 | | |
211 | | |
212 | o | 3: 'D'
212 | o | 3: 'D'
213 | |\|
213 | |\|
214 | o | 2: 'C'
214 | o | 2: 'C'
215 |/ /
215 |/ /
216 | o 1: 'B'
216 | o 1: 'B'
217 |/
217 |/
218 o 0: 'A'
218 o 0: 'A'
219
219
220 $ cd ..
220 $ cd ..
221
221
222
222
223 Rebase and collapse - more than one external (fail):
223 Rebase and collapse - more than one external (fail):
224
224
225 $ hg clone -q -u . b b1
225 $ hg clone -q -u . b b1
226 $ cd b1
226 $ cd b1
227
227
228 $ hg rebase -s 2 --collapse
228 $ hg rebase -s 2 --collapse
229 abort: unable to collapse, there is more than one external parent
229 abort: unable to collapse, there is more than one external parent
230 [255]
230 [255]
231
231
232 Rebase and collapse - E onto H:
232 Rebase and collapse - E onto H:
233
233
234 $ hg rebase -s 4 --collapse # root (4) is not a merge
234 $ hg rebase -s 4 --collapse # root (4) is not a merge
235 saved backup bundle to $TESTTMP/b1/.hg/strip-backup/*-backup.hg (glob)
235 saved backup bundle to $TESTTMP/b1/.hg/strip-backup/*-backup.hg (glob)
236
236
237 $ hg tglog
237 $ hg tglog
238 @ 5: 'Collapsed revision
238 @ 5: 'Collapsed revision
239 |\ * E
239 |\ * E
240 | | * F
240 | | * F
241 | | * G'
241 | | * G'
242 | o 4: 'H'
242 | o 4: 'H'
243 | |
243 | |
244 o | 3: 'D'
244 o | 3: 'D'
245 |\ \
245 |\ \
246 | o | 2: 'C'
246 | o | 2: 'C'
247 | |/
247 | |/
248 o / 1: 'B'
248 o / 1: 'B'
249 |/
249 |/
250 o 0: 'A'
250 o 0: 'A'
251
251
252 $ hg manifest
252 $ hg manifest
253 A
253 A
254 C
254 C
255 D
255 D
256 E
256 E
257 F
257 F
258 H
258 H
259
259
260 $ cd ..
260 $ cd ..
261
261
262
262
263
263
264
264
265 Test that branchheads cache is updated correctly when doing a strip in which
265 Test that branchheads cache is updated correctly when doing a strip in which
266 the parent of the ancestor node to be stripped does not become a head and
266 the parent of the ancestor node to be stripped does not become a head and
267 also, the parent of a node that is a child of the node stripped becomes a head
267 also, the parent of a node that is a child of the node stripped becomes a head
268 (node 3).
268 (node 3).
269
269
270 $ hg clone -q -u . b b2
270 $ hg clone -q -u . b b2
271 $ cd b2
271 $ cd b2
272
272
273 $ hg heads --template="{rev}:{node} {branch}\n"
273 $ hg heads --template="{rev}:{node} {branch}\n"
274 7:c65502d4178782309ce0574c5ae6ee9485a9bafa default
274 7:c65502d4178782309ce0574c5ae6ee9485a9bafa default
275 6:c772a8b2dc17629cec88a19d09c926c4814b12c7 default
275 6:c772a8b2dc17629cec88a19d09c926c4814b12c7 default
276
276
277 $ cat $TESTTMP/b2/.hg/cache/branchheads
277 $ cat $TESTTMP/b2/.hg/cache/branchheads-unserved
278 c65502d4178782309ce0574c5ae6ee9485a9bafa 7
278 c65502d4178782309ce0574c5ae6ee9485a9bafa 7
279 c772a8b2dc17629cec88a19d09c926c4814b12c7 default
279 c772a8b2dc17629cec88a19d09c926c4814b12c7 default
280 c65502d4178782309ce0574c5ae6ee9485a9bafa default
280 c65502d4178782309ce0574c5ae6ee9485a9bafa default
281
281
282 $ hg strip 4
282 $ hg strip 4
283 saved backup bundle to $TESTTMP/b2/.hg/strip-backup/8a5212ebc852-backup.hg (glob)
283 saved backup bundle to $TESTTMP/b2/.hg/strip-backup/8a5212ebc852-backup.hg (glob)
284
284
285 $ cat $TESTTMP/b2/.hg/cache/branchheads
285 $ cat $TESTTMP/b2/.hg/cache/branchheads
286 c65502d4178782309ce0574c5ae6ee9485a9bafa 4
286 c65502d4178782309ce0574c5ae6ee9485a9bafa 4
287 2870ad076e541e714f3c2bc32826b5c6a6e5b040 default
287 2870ad076e541e714f3c2bc32826b5c6a6e5b040 default
288 c65502d4178782309ce0574c5ae6ee9485a9bafa default
288 c65502d4178782309ce0574c5ae6ee9485a9bafa default
289
289
290 $ hg heads --template="{rev}:{node} {branch}\n"
290 $ hg heads --template="{rev}:{node} {branch}\n"
291 4:c65502d4178782309ce0574c5ae6ee9485a9bafa default
291 4:c65502d4178782309ce0574c5ae6ee9485a9bafa default
292 3:2870ad076e541e714f3c2bc32826b5c6a6e5b040 default
292 3:2870ad076e541e714f3c2bc32826b5c6a6e5b040 default
293
293
294 $ cd ..
294 $ cd ..
295
295
296
296
297
297
298
298
299
299
300
300
301 Create repo c:
301 Create repo c:
302
302
303 $ hg init c
303 $ hg init c
304 $ cd c
304 $ cd c
305
305
306 $ echo A > A
306 $ echo A > A
307 $ hg ci -Am A
307 $ hg ci -Am A
308 adding A
308 adding A
309 $ echo B > B
309 $ echo B > B
310 $ hg ci -Am B
310 $ hg ci -Am B
311 adding B
311 adding B
312
312
313 $ hg up -q 0
313 $ hg up -q 0
314
314
315 $ echo C > C
315 $ echo C > C
316 $ hg ci -Am C
316 $ hg ci -Am C
317 adding C
317 adding C
318 created new head
318 created new head
319
319
320 $ hg merge
320 $ hg merge
321 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
321 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
322 (branch merge, don't forget to commit)
322 (branch merge, don't forget to commit)
323
323
324 $ echo D > D
324 $ echo D > D
325 $ hg ci -Am D
325 $ hg ci -Am D
326 adding D
326 adding D
327
327
328 $ hg up -q 1
328 $ hg up -q 1
329
329
330 $ echo E > E
330 $ echo E > E
331 $ hg ci -Am E
331 $ hg ci -Am E
332 adding E
332 adding E
333 created new head
333 created new head
334 $ echo F > E
334 $ echo F > E
335 $ hg ci -m 'F'
335 $ hg ci -m 'F'
336
336
337 $ echo G > G
337 $ echo G > G
338 $ hg ci -Am G
338 $ hg ci -Am G
339 adding G
339 adding G
340
340
341 $ hg merge
341 $ hg merge
342 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
342 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
343 (branch merge, don't forget to commit)
343 (branch merge, don't forget to commit)
344
344
345 $ hg ci -m H
345 $ hg ci -m H
346
346
347 $ hg up -q 0
347 $ hg up -q 0
348
348
349 $ echo I > I
349 $ echo I > I
350 $ hg ci -Am I
350 $ hg ci -Am I
351 adding I
351 adding I
352 created new head
352 created new head
353
353
354 $ hg tglog
354 $ hg tglog
355 @ 8: 'I'
355 @ 8: 'I'
356 |
356 |
357 | o 7: 'H'
357 | o 7: 'H'
358 | |\
358 | |\
359 | | o 6: 'G'
359 | | o 6: 'G'
360 | | |
360 | | |
361 | | o 5: 'F'
361 | | o 5: 'F'
362 | | |
362 | | |
363 | | o 4: 'E'
363 | | o 4: 'E'
364 | | |
364 | | |
365 | o | 3: 'D'
365 | o | 3: 'D'
366 | |\|
366 | |\|
367 | o | 2: 'C'
367 | o | 2: 'C'
368 |/ /
368 |/ /
369 | o 1: 'B'
369 | o 1: 'B'
370 |/
370 |/
371 o 0: 'A'
371 o 0: 'A'
372
372
373 $ cd ..
373 $ cd ..
374
374
375
375
376 Rebase and collapse - E onto I:
376 Rebase and collapse - E onto I:
377
377
378 $ hg clone -q -u . c c1
378 $ hg clone -q -u . c c1
379 $ cd c1
379 $ cd c1
380
380
381 $ hg rebase -s 4 --collapse # root (4) is not a merge
381 $ hg rebase -s 4 --collapse # root (4) is not a merge
382 merging E
382 merging E
383 saved backup bundle to $TESTTMP/c1/.hg/strip-backup/*-backup.hg (glob)
383 saved backup bundle to $TESTTMP/c1/.hg/strip-backup/*-backup.hg (glob)
384
384
385 $ hg tglog
385 $ hg tglog
386 @ 5: 'Collapsed revision
386 @ 5: 'Collapsed revision
387 |\ * E
387 |\ * E
388 | | * F
388 | | * F
389 | | * G
389 | | * G
390 | | * H'
390 | | * H'
391 | o 4: 'I'
391 | o 4: 'I'
392 | |
392 | |
393 o | 3: 'D'
393 o | 3: 'D'
394 |\ \
394 |\ \
395 | o | 2: 'C'
395 | o | 2: 'C'
396 | |/
396 | |/
397 o / 1: 'B'
397 o / 1: 'B'
398 |/
398 |/
399 o 0: 'A'
399 o 0: 'A'
400
400
401 $ hg manifest
401 $ hg manifest
402 A
402 A
403 C
403 C
404 D
404 D
405 E
405 E
406 G
406 G
407 I
407 I
408
408
409 $ cat E
409 $ cat E
410 F
410 F
411
411
412 $ cd ..
412 $ cd ..
413
413
414
414
415 Create repo d:
415 Create repo d:
416
416
417 $ hg init d
417 $ hg init d
418 $ cd d
418 $ cd d
419
419
420 $ echo A > A
420 $ echo A > A
421 $ hg ci -Am A
421 $ hg ci -Am A
422 adding A
422 adding A
423 $ echo B > B
423 $ echo B > B
424 $ hg ci -Am B
424 $ hg ci -Am B
425 adding B
425 adding B
426 $ echo C > C
426 $ echo C > C
427 $ hg ci -Am C
427 $ hg ci -Am C
428 adding C
428 adding C
429
429
430 $ hg up -q 1
430 $ hg up -q 1
431
431
432 $ echo D > D
432 $ echo D > D
433 $ hg ci -Am D
433 $ hg ci -Am D
434 adding D
434 adding D
435 created new head
435 created new head
436 $ hg merge
436 $ hg merge
437 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
437 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
438 (branch merge, don't forget to commit)
438 (branch merge, don't forget to commit)
439
439
440 $ hg ci -m E
440 $ hg ci -m E
441
441
442 $ hg up -q 0
442 $ hg up -q 0
443
443
444 $ echo F > F
444 $ echo F > F
445 $ hg ci -Am F
445 $ hg ci -Am F
446 adding F
446 adding F
447 created new head
447 created new head
448
448
449 $ hg tglog
449 $ hg tglog
450 @ 5: 'F'
450 @ 5: 'F'
451 |
451 |
452 | o 4: 'E'
452 | o 4: 'E'
453 | |\
453 | |\
454 | | o 3: 'D'
454 | | o 3: 'D'
455 | | |
455 | | |
456 | o | 2: 'C'
456 | o | 2: 'C'
457 | |/
457 | |/
458 | o 1: 'B'
458 | o 1: 'B'
459 |/
459 |/
460 o 0: 'A'
460 o 0: 'A'
461
461
462 $ cd ..
462 $ cd ..
463
463
464
464
465 Rebase and collapse - B onto F:
465 Rebase and collapse - B onto F:
466
466
467 $ hg clone -q -u . d d1
467 $ hg clone -q -u . d d1
468 $ cd d1
468 $ cd d1
469
469
470 $ hg rebase -s 1 --collapse
470 $ hg rebase -s 1 --collapse
471 saved backup bundle to $TESTTMP/d1/.hg/strip-backup/*-backup.hg (glob)
471 saved backup bundle to $TESTTMP/d1/.hg/strip-backup/*-backup.hg (glob)
472
472
473 $ hg tglog
473 $ hg tglog
474 @ 2: 'Collapsed revision
474 @ 2: 'Collapsed revision
475 | * B
475 | * B
476 | * C
476 | * C
477 | * D
477 | * D
478 | * E'
478 | * E'
479 o 1: 'F'
479 o 1: 'F'
480 |
480 |
481 o 0: 'A'
481 o 0: 'A'
482
482
483 $ hg manifest
483 $ hg manifest
484 A
484 A
485 B
485 B
486 C
486 C
487 D
487 D
488 F
488 F
489
489
490 Interactions between collapse and keepbranches
490 Interactions between collapse and keepbranches
491 $ cd ..
491 $ cd ..
492 $ hg init e
492 $ hg init e
493 $ cd e
493 $ cd e
494 $ echo 'a' > a
494 $ echo 'a' > a
495 $ hg ci -Am 'A'
495 $ hg ci -Am 'A'
496 adding a
496 adding a
497
497
498 $ hg branch '1'
498 $ hg branch '1'
499 marked working directory as branch 1
499 marked working directory as branch 1
500 (branches are permanent and global, did you want a bookmark?)
500 (branches are permanent and global, did you want a bookmark?)
501 $ echo 'b' > b
501 $ echo 'b' > b
502 $ hg ci -Am 'B'
502 $ hg ci -Am 'B'
503 adding b
503 adding b
504
504
505 $ hg branch '2'
505 $ hg branch '2'
506 marked working directory as branch 2
506 marked working directory as branch 2
507 (branches are permanent and global, did you want a bookmark?)
507 (branches are permanent and global, did you want a bookmark?)
508 $ echo 'c' > c
508 $ echo 'c' > c
509 $ hg ci -Am 'C'
509 $ hg ci -Am 'C'
510 adding c
510 adding c
511
511
512 $ hg up -q 0
512 $ hg up -q 0
513 $ echo 'd' > d
513 $ echo 'd' > d
514 $ hg ci -Am 'D'
514 $ hg ci -Am 'D'
515 adding d
515 adding d
516
516
517 $ hg tglog
517 $ hg tglog
518 @ 3: 'D'
518 @ 3: 'D'
519 |
519 |
520 | o 2: 'C' 2
520 | o 2: 'C' 2
521 | |
521 | |
522 | o 1: 'B' 1
522 | o 1: 'B' 1
523 |/
523 |/
524 o 0: 'A'
524 o 0: 'A'
525
525
526 $ hg rebase --keepbranches --collapse -s 1 -d 3
526 $ hg rebase --keepbranches --collapse -s 1 -d 3
527 abort: cannot collapse multiple named branches
527 abort: cannot collapse multiple named branches
528 [255]
528 [255]
529
529
530 $ repeatchange() {
530 $ repeatchange() {
531 > hg checkout $1
531 > hg checkout $1
532 > hg cp d z
532 > hg cp d z
533 > echo blah >> z
533 > echo blah >> z
534 > hg commit -Am "$2" --user "$3"
534 > hg commit -Am "$2" --user "$3"
535 > }
535 > }
536 $ repeatchange 3 "E" "user1"
536 $ repeatchange 3 "E" "user1"
537 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
537 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
538 $ repeatchange 3 "E" "user2"
538 $ repeatchange 3 "E" "user2"
539 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
539 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
540 created new head
540 created new head
541 $ hg tglog
541 $ hg tglog
542 @ 5: 'E'
542 @ 5: 'E'
543 |
543 |
544 | o 4: 'E'
544 | o 4: 'E'
545 |/
545 |/
546 o 3: 'D'
546 o 3: 'D'
547 |
547 |
548 | o 2: 'C' 2
548 | o 2: 'C' 2
549 | |
549 | |
550 | o 1: 'B' 1
550 | o 1: 'B' 1
551 |/
551 |/
552 o 0: 'A'
552 o 0: 'A'
553
553
554 $ hg rebase -s 5 -d 4
554 $ hg rebase -s 5 -d 4
555 saved backup bundle to $TESTTMP/e/.hg/strip-backup/*-backup.hg (glob)
555 saved backup bundle to $TESTTMP/e/.hg/strip-backup/*-backup.hg (glob)
556 $ hg tglog
556 $ hg tglog
557 @ 4: 'E'
557 @ 4: 'E'
558 |
558 |
559 o 3: 'D'
559 o 3: 'D'
560 |
560 |
561 | o 2: 'C' 2
561 | o 2: 'C' 2
562 | |
562 | |
563 | o 1: 'B' 1
563 | o 1: 'B' 1
564 |/
564 |/
565 o 0: 'A'
565 o 0: 'A'
566
566
567 $ hg export tip
567 $ hg export tip
568 # HG changeset patch
568 # HG changeset patch
569 # User user1
569 # User user1
570 # Date 0 0
570 # Date 0 0
571 # Node ID f338eb3c2c7cc5b5915676a2376ba7ac558c5213
571 # Node ID f338eb3c2c7cc5b5915676a2376ba7ac558c5213
572 # Parent 41acb9dca9eb976e84cd21fcb756b4afa5a35c09
572 # Parent 41acb9dca9eb976e84cd21fcb756b4afa5a35c09
573 E
573 E
574
574
575 diff -r 41acb9dca9eb -r f338eb3c2c7c z
575 diff -r 41acb9dca9eb -r f338eb3c2c7c z
576 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
576 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
577 +++ b/z Thu Jan 01 00:00:00 1970 +0000
577 +++ b/z Thu Jan 01 00:00:00 1970 +0000
578 @@ -0,0 +1,2 @@
578 @@ -0,0 +1,2 @@
579 +d
579 +d
580 +blah
580 +blah
581
581
582 $ cd ..
582 $ cd ..
583
583
584 Rebase, collapse and copies
584 Rebase, collapse and copies
585
585
586 $ hg init copies
586 $ hg init copies
587 $ cd copies
587 $ cd copies
588 $ hg unbundle "$TESTDIR/bundles/renames.hg"
588 $ hg unbundle "$TESTDIR/bundles/renames.hg"
589 adding changesets
589 adding changesets
590 adding manifests
590 adding manifests
591 adding file changes
591 adding file changes
592 added 4 changesets with 11 changes to 7 files (+1 heads)
592 added 4 changesets with 11 changes to 7 files (+1 heads)
593 (run 'hg heads' to see heads, 'hg merge' to merge)
593 (run 'hg heads' to see heads, 'hg merge' to merge)
594 $ hg up -q tip
594 $ hg up -q tip
595 $ hg tglog
595 $ hg tglog
596 @ 3: 'move2'
596 @ 3: 'move2'
597 |
597 |
598 o 2: 'move1'
598 o 2: 'move1'
599 |
599 |
600 | o 1: 'change'
600 | o 1: 'change'
601 |/
601 |/
602 o 0: 'add'
602 o 0: 'add'
603
603
604 $ hg rebase --collapse -d 1
604 $ hg rebase --collapse -d 1
605 merging a and d to d
605 merging a and d to d
606 merging b and e to e
606 merging b and e to e
607 merging c and f to f
607 merging c and f to f
608 merging e and g to g
608 merging e and g to g
609 merging f and c to c
609 merging f and c to c
610 saved backup bundle to $TESTTMP/copies/.hg/strip-backup/*-backup.hg (glob)
610 saved backup bundle to $TESTTMP/copies/.hg/strip-backup/*-backup.hg (glob)
611 $ hg st
611 $ hg st
612 $ hg st --copies --change .
612 $ hg st --copies --change .
613 A d
613 A d
614 a
614 a
615 A g
615 A g
616 b
616 b
617 R b
617 R b
618 $ cat c
618 $ cat c
619 c
619 c
620 c
620 c
621 $ cat d
621 $ cat d
622 a
622 a
623 a
623 a
624 $ cat g
624 $ cat g
625 b
625 b
626 b
626 b
627 $ hg log -r . --template "{file_copies}\n"
627 $ hg log -r . --template "{file_copies}\n"
628 d (a)g (b)
628 d (a)g (b)
629
629
630 Test collapsing a middle revision in-place
630 Test collapsing a middle revision in-place
631
631
632 $ hg tglog
632 $ hg tglog
633 @ 2: 'Collapsed revision
633 @ 2: 'Collapsed revision
634 | * move1
634 | * move1
635 | * move2'
635 | * move2'
636 o 1: 'change'
636 o 1: 'change'
637 |
637 |
638 o 0: 'add'
638 o 0: 'add'
639
639
640 $ hg rebase --collapse -r 1 -d 0
640 $ hg rebase --collapse -r 1 -d 0
641 abort: can't remove original changesets with unrebased descendants
641 abort: can't remove original changesets with unrebased descendants
642 (use --keep to keep original changesets)
642 (use --keep to keep original changesets)
643 [255]
643 [255]
644
644
645 Test collapsing in place
645 Test collapsing in place
646
646
647 $ hg rebase --collapse -b . -d 0
647 $ hg rebase --collapse -b . -d 0
648 saved backup bundle to $TESTTMP/copies/.hg/strip-backup/*-backup.hg (glob)
648 saved backup bundle to $TESTTMP/copies/.hg/strip-backup/*-backup.hg (glob)
649 $ hg st --change . --copies
649 $ hg st --change . --copies
650 M a
650 M a
651 M c
651 M c
652 A d
652 A d
653 a
653 a
654 A g
654 A g
655 b
655 b
656 R b
656 R b
657 $ cat a
657 $ cat a
658 a
658 a
659 a
659 a
660 $ cat c
660 $ cat c
661 c
661 c
662 c
662 c
663 $ cat d
663 $ cat d
664 a
664 a
665 a
665 a
666 $ cat g
666 $ cat g
667 b
667 b
668 b
668 b
669 $ cd ..
669 $ cd ..
670
670
671
671
672 Test stripping a revision with another child
672 Test stripping a revision with another child
673
673
674 $ hg init f
674 $ hg init f
675 $ cd f
675 $ cd f
676
676
677 $ echo A > A
677 $ echo A > A
678 $ hg ci -Am A
678 $ hg ci -Am A
679 adding A
679 adding A
680 $ echo B > B
680 $ echo B > B
681 $ hg ci -Am B
681 $ hg ci -Am B
682 adding B
682 adding B
683
683
684 $ hg up -q 0
684 $ hg up -q 0
685
685
686 $ echo C > C
686 $ echo C > C
687 $ hg ci -Am C
687 $ hg ci -Am C
688 adding C
688 adding C
689 created new head
689 created new head
690
690
691 $ hg tglog
691 $ hg tglog
692 @ 2: 'C'
692 @ 2: 'C'
693 |
693 |
694 | o 1: 'B'
694 | o 1: 'B'
695 |/
695 |/
696 o 0: 'A'
696 o 0: 'A'
697
697
698
698
699
699
700 $ hg heads --template="{rev}:{node} {branch}: {desc}\n"
700 $ hg heads --template="{rev}:{node} {branch}: {desc}\n"
701 2:c5cefa58fd557f84b72b87f970135984337acbc5 default: C
701 2:c5cefa58fd557f84b72b87f970135984337acbc5 default: C
702 1:27547f69f25460a52fff66ad004e58da7ad3fb56 default: B
702 1:27547f69f25460a52fff66ad004e58da7ad3fb56 default: B
703
703
704 $ hg strip 2
704 $ hg strip 2
705 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
705 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
706 saved backup bundle to $TESTTMP/f/.hg/strip-backup/*-backup.hg (glob)
706 saved backup bundle to $TESTTMP/f/.hg/strip-backup/*-backup.hg (glob)
707
707
708 $ hg tglog
708 $ hg tglog
709 o 1: 'B'
709 o 1: 'B'
710 |
710 |
711 @ 0: 'A'
711 @ 0: 'A'
712
712
713
713
714
714
715 $ hg heads --template="{rev}:{node} {branch}: {desc}\n"
715 $ hg heads --template="{rev}:{node} {branch}: {desc}\n"
716 1:27547f69f25460a52fff66ad004e58da7ad3fb56 default: B
716 1:27547f69f25460a52fff66ad004e58da7ad3fb56 default: B
717
717
718 $ cd ..
718 $ cd ..
719
719
720
720
721
721
722
722
General Comments 0
You need to be logged in to leave comments. Login now