Show More
@@ -1,173 +1,175 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 |
|
10 | |||
11 | def read(repo): |
|
11 | def read(repo): | |
12 | partial = branchcache() |
|
|||
13 | try: |
|
12 | try: | |
14 | f = repo.opener("cache/branchheads") |
|
13 | f = repo.opener("cache/branchheads") | |
15 | lines = f.read().split('\n') |
|
14 | lines = f.read().split('\n') | |
16 | f.close() |
|
15 | f.close() | |
17 | except (IOError, OSError): |
|
16 | except (IOError, OSError): | |
18 | return branchcache() |
|
17 | return branchcache() | |
19 |
|
18 | |||
20 | try: |
|
19 | try: | |
21 | last, lrev = lines.pop(0).split(" ", 1) |
|
20 | last, lrev = lines.pop(0).split(" ", 1) | |
22 | last, lrev = bin(last), int(lrev) |
|
21 | last, lrev = bin(last), int(lrev) | |
23 | if lrev >= len(repo) or repo[lrev].node() != last: |
|
22 | partial = branchcache(tipnode=last, tiprev=lrev) | |
|
23 | if not partial.validfor(repo): | |||
24 | # invalidate the cache |
|
24 | # invalidate the cache | |
25 | raise ValueError('invalidating branch cache (tip differs)') |
|
25 | raise ValueError('invalidating branch cache (tip differs)') | |
26 | for l in lines: |
|
26 | for l in lines: | |
27 | if not l: |
|
27 | if not l: | |
28 | continue |
|
28 | continue | |
29 | node, label = l.split(" ", 1) |
|
29 | node, label = l.split(" ", 1) | |
30 | label = encoding.tolocal(label.strip()) |
|
30 | label = encoding.tolocal(label.strip()) | |
31 | if not node in repo: |
|
31 | if not node in repo: | |
32 | raise ValueError('invalidating branch cache because node '+ |
|
32 | raise ValueError('invalidating branch cache because node '+ | |
33 | '%s does not exist' % node) |
|
33 | '%s does not exist' % node) | |
34 | partial.setdefault(label, []).append(bin(node)) |
|
34 | partial.setdefault(label, []).append(bin(node)) | |
35 | partial.tipnode = last |
|
|||
36 | partial.tiprev = lrev |
|
|||
37 | except KeyboardInterrupt: |
|
35 | except KeyboardInterrupt: | |
38 | raise |
|
36 | raise | |
39 | except Exception, inst: |
|
37 | except Exception, inst: | |
40 | if repo.ui.debugflag: |
|
38 | if repo.ui.debugflag: | |
41 | repo.ui.warn(str(inst), '\n') |
|
39 | repo.ui.warn(str(inst), '\n') | |
42 | partial = branchcache() |
|
40 | partial = branchcache() | |
43 | return partial |
|
41 | return partial | |
44 |
|
42 | |||
45 |
|
43 | |||
46 |
|
44 | |||
47 | def updatecache(repo): |
|
45 | def updatecache(repo): | |
48 | repo = repo.unfiltered() # Until we get a smarter cache management |
|
46 | repo = repo.unfiltered() # Until we get a smarter cache management | |
49 | cl = repo.changelog |
|
47 | cl = repo.changelog | |
50 | tip = cl.tip() |
|
|||
51 | partial = repo._branchcache |
|
48 | partial = repo._branchcache | |
52 | if partial is not None and partial.tipnode == tip: |
|
|||
53 | return |
|
|||
54 |
|
49 | |||
55 |
if partial is None or partial. |
|
50 | if partial is None or not partial.validfor(repo): | |
56 | partial = read(repo) |
|
51 | partial = read(repo) | |
57 |
|
52 | |||
58 | catip = repo._cacheabletip() |
|
53 | catip = repo._cacheabletip() | |
59 | # if partial.tiprev == catip: cache is already up to date |
|
54 | # if partial.tiprev == catip: cache is already up to date | |
60 | # if partial.tiprev > catip: we have uncachable element in `partial` can't |
|
55 | # if partial.tiprev > catip: we have uncachable element in `partial` can't | |
61 | # write on disk |
|
56 | # write on disk | |
62 | if partial.tiprev < catip: |
|
57 | if partial.tiprev < catip: | |
63 | ctxgen = (repo[r] for r in cl.revs(partial.tiprev + 1, catip)) |
|
58 | ctxgen = (repo[r] for r in cl.revs(partial.tiprev + 1, catip)) | |
64 | partial.update(repo, ctxgen) |
|
59 | partial.update(repo, ctxgen) | |
65 | partial.write(repo) |
|
60 | partial.write(repo) | |
66 | # If cacheable tip were lower than actual tip, we need to update the |
|
61 | # If cacheable tip were lower than actual tip, we need to update the | |
67 | # cache up to tip. This update (from cacheable to actual tip) is not |
|
62 | # cache up to tip. This update (from cacheable to actual tip) is not | |
68 | # written to disk since it's not cacheable. |
|
63 | # written to disk since it's not cacheable. | |
69 | tiprev = len(repo) - 1 |
|
64 | tiprev = len(repo) - 1 | |
70 | if partial.tiprev < tiprev: |
|
65 | if partial.tiprev < tiprev: | |
71 | ctxgen = (repo[r] for r in cl.revs(partial.tiprev + 1, tiprev)) |
|
66 | ctxgen = (repo[r] for r in cl.revs(partial.tiprev + 1, tiprev)) | |
72 | partial.update(repo, ctxgen) |
|
67 | partial.update(repo, ctxgen) | |
73 | repo._branchcache = partial |
|
68 | repo._branchcache = partial | |
74 |
|
69 | |||
75 | class branchcache(dict): |
|
70 | class branchcache(dict): | |
76 | """A dict like object that hold branches heads cache""" |
|
71 | """A dict like object that hold branches heads cache""" | |
77 |
|
72 | |||
78 | def __init__(self, entries=(), tipnode=nullid, tiprev=nullrev): |
|
73 | def __init__(self, entries=(), tipnode=nullid, tiprev=nullrev): | |
79 | super(branchcache, self).__init__(entries) |
|
74 | super(branchcache, self).__init__(entries) | |
80 | self.tipnode = tipnode |
|
75 | self.tipnode = tipnode | |
81 | self.tiprev = tiprev |
|
76 | self.tiprev = tiprev | |
82 |
|
77 | |||
|
78 | def validfor(self, repo): | |||
|
79 | """Is the cache content valide regarding a repo | |||
|
80 | ||||
|
81 | - False when cached tipnode are unknown or if we detect a strip. | |||
|
82 | - True when cache is up to date or a subset of current repo.""" | |||
|
83 | try: | |||
|
84 | return self.tipnode == repo.changelog.node(self.tiprev) | |||
|
85 | except IndexError: | |||
|
86 | return False | |||
|
87 | ||||
|
88 | ||||
83 | def write(self, repo): |
|
89 | def write(self, repo): | |
84 | try: |
|
90 | try: | |
85 | f = repo.opener("cache/branchheads", "w", atomictemp=True) |
|
91 | f = repo.opener("cache/branchheads", "w", atomictemp=True) | |
86 | f.write("%s %s\n" % (hex(self.tipnode), self.tiprev)) |
|
92 | f.write("%s %s\n" % (hex(self.tipnode), self.tiprev)) | |
87 | for label, nodes in self.iteritems(): |
|
93 | for label, nodes in self.iteritems(): | |
88 | for node in nodes: |
|
94 | for node in nodes: | |
89 | f.write("%s %s\n" % (hex(node), encoding.fromlocal(label))) |
|
95 | f.write("%s %s\n" % (hex(node), encoding.fromlocal(label))) | |
90 | f.close() |
|
96 | f.close() | |
91 | except (IOError, OSError): |
|
97 | except (IOError, OSError): | |
92 | pass |
|
98 | pass | |
93 |
|
99 | |||
94 | def update(self, repo, ctxgen): |
|
100 | def update(self, repo, ctxgen): | |
95 | """Given a branchhead cache, self, that may have extra nodes or be |
|
101 | """Given a branchhead cache, self, that may have extra nodes or be | |
96 | missing heads, and a generator of nodes that are at least a superset of |
|
102 | missing heads, and a generator of nodes that are at least a superset of | |
97 | heads missing, this function updates self to be correct. |
|
103 | heads missing, this function updates self to be correct. | |
98 | """ |
|
104 | """ | |
99 | cl = repo.changelog |
|
105 | cl = repo.changelog | |
100 | # collect new branch entries |
|
106 | # collect new branch entries | |
101 | newbranches = {} |
|
107 | newbranches = {} | |
102 | for c in ctxgen: |
|
108 | for c in ctxgen: | |
103 | newbranches.setdefault(c.branch(), []).append(c.node()) |
|
109 | newbranches.setdefault(c.branch(), []).append(c.node()) | |
104 | # if older branchheads are reachable from new ones, they aren't |
|
110 | # if older branchheads are reachable from new ones, they aren't | |
105 | # really branchheads. Note checking parents is insufficient: |
|
111 | # really branchheads. Note checking parents is insufficient: | |
106 | # 1 (branch a) -> 2 (branch b) -> 3 (branch a) |
|
112 | # 1 (branch a) -> 2 (branch b) -> 3 (branch a) | |
107 | for branch, newnodes in newbranches.iteritems(): |
|
113 | for branch, newnodes in newbranches.iteritems(): | |
108 | bheads = self.setdefault(branch, []) |
|
114 | bheads = self.setdefault(branch, []) | |
109 | # Remove candidate heads that no longer are in the repo (e.g., as |
|
115 | # Remove candidate heads that no longer are in the repo (e.g., as | |
110 | # the result of a strip that just happened). Avoid using 'node in |
|
116 | # the result of a strip that just happened). Avoid using 'node in | |
111 | # self' here because that dives down into branchcache code somewhat |
|
117 | # self' here because that dives down into branchcache code somewhat | |
112 | # recursively. |
|
118 | # recursively. | |
113 | bheadrevs = [cl.rev(node) for node in bheads |
|
119 | bheadrevs = [cl.rev(node) for node in bheads | |
114 | if cl.hasnode(node)] |
|
120 | if cl.hasnode(node)] | |
115 | newheadrevs = [cl.rev(node) for node in newnodes |
|
121 | newheadrevs = [cl.rev(node) for node in newnodes | |
116 | if cl.hasnode(node)] |
|
122 | if cl.hasnode(node)] | |
117 | ctxisnew = bheadrevs and min(newheadrevs) > max(bheadrevs) |
|
123 | ctxisnew = bheadrevs and min(newheadrevs) > max(bheadrevs) | |
118 | # Remove duplicates - nodes that are in newheadrevs and are already |
|
124 | # Remove duplicates - nodes that are in newheadrevs and are already | |
119 | # in bheadrevs. This can happen if you strip a node whose parent |
|
125 | # in bheadrevs. This can happen if you strip a node whose parent | |
120 | # was already a head (because they're on different branches). |
|
126 | # was already a head (because they're on different branches). | |
121 | bheadrevs = sorted(set(bheadrevs).union(newheadrevs)) |
|
127 | bheadrevs = sorted(set(bheadrevs).union(newheadrevs)) | |
122 |
|
128 | |||
123 | # Starting from tip means fewer passes over reachable. If we know |
|
129 | # Starting from tip means fewer passes over reachable. If we know | |
124 | # the new candidates are not ancestors of existing heads, we don't |
|
130 | # the new candidates are not ancestors of existing heads, we don't | |
125 | # have to examine ancestors of existing heads |
|
131 | # have to examine ancestors of existing heads | |
126 | if ctxisnew: |
|
132 | if ctxisnew: | |
127 | iterrevs = sorted(newheadrevs) |
|
133 | iterrevs = sorted(newheadrevs) | |
128 | else: |
|
134 | else: | |
129 | iterrevs = list(bheadrevs) |
|
135 | iterrevs = list(bheadrevs) | |
130 |
|
136 | |||
131 | # This loop prunes out two kinds of heads - heads that are |
|
137 | # This loop prunes out two kinds of heads - heads that are | |
132 | # superseded by a head in newheadrevs, and newheadrevs that are not |
|
138 | # superseded by a head in newheadrevs, and newheadrevs that are not | |
133 | # heads because an existing head is their descendant. |
|
139 | # heads because an existing head is their descendant. | |
134 | while iterrevs: |
|
140 | while iterrevs: | |
135 | latest = iterrevs.pop() |
|
141 | latest = iterrevs.pop() | |
136 | if latest not in bheadrevs: |
|
142 | if latest not in bheadrevs: | |
137 | continue |
|
143 | continue | |
138 | ancestors = set(cl.ancestors([latest], |
|
144 | ancestors = set(cl.ancestors([latest], | |
139 | bheadrevs[0])) |
|
145 | bheadrevs[0])) | |
140 | if ancestors: |
|
146 | if ancestors: | |
141 | bheadrevs = [b for b in bheadrevs if b not in ancestors] |
|
147 | bheadrevs = [b for b in bheadrevs if b not in ancestors] | |
142 | self[branch] = [cl.node(rev) for rev in bheadrevs] |
|
148 | self[branch] = [cl.node(rev) for rev in bheadrevs] | |
143 | tiprev = max(bheadrevs) |
|
149 | tiprev = max(bheadrevs) | |
144 | if tiprev > self.tiprev: |
|
150 | if tiprev > self.tiprev: | |
145 | self.tipnode = cl.node(tiprev) |
|
151 | self.tipnode = cl.node(tiprev) | |
146 | self.tiprev = tiprev |
|
152 | self.tiprev = tiprev | |
147 |
|
153 | |||
148 | # There may be branches that cease to exist when the last commit in the |
|
154 | # There may be branches that cease to exist when the last commit in the | |
149 | # branch was stripped. This code filters them out. Note that the |
|
155 | # branch was stripped. This code filters them out. Note that the | |
150 | # branch that ceased to exist may not be in newbranches because |
|
156 | # branch that ceased to exist may not be in newbranches because | |
151 | # newbranches is the set of candidate heads, which when you strip the |
|
157 | # newbranches is the set of candidate heads, which when you strip the | |
152 | # last commit in a branch will be the parent branch. |
|
158 | # last commit in a branch will be the parent branch. | |
153 | droppednodes = [] |
|
159 | droppednodes = [] | |
154 | for branch in self.keys(): |
|
160 | for branch in self.keys(): | |
155 | nodes = [head for head in self[branch] |
|
161 | nodes = [head for head in self[branch] | |
156 | if cl.hasnode(head)] |
|
162 | if cl.hasnode(head)] | |
157 | if not nodes: |
|
163 | if not nodes: | |
158 | droppednodes.extend(nodes) |
|
164 | droppednodes.extend(nodes) | |
159 | del self[branch] |
|
165 | del self[branch] | |
160 | try: |
|
166 | if ((not self.validfor(repo)) or (self.tipnode in droppednodes)): | |
161 | node = cl.node(self.tiprev) |
|
167 | ||
162 | except IndexError: |
|
|||
163 | node = None |
|
|||
164 | if ((self.tipnode != node) |
|
|||
165 | or (self.tipnode in droppednodes)): |
|
|||
166 | # cache key are not valid anymore |
|
168 | # cache key are not valid anymore | |
167 | self.tipnode = nullid |
|
169 | self.tipnode = nullid | |
168 | self.tiprev = nullrev |
|
170 | self.tiprev = nullrev | |
169 | for heads in self.values(): |
|
171 | for heads in self.values(): | |
170 | tiprev = max(cl.rev(node) for node in heads) |
|
172 | tiprev = max(cl.rev(node) for node in heads) | |
171 | if tiprev > self.tiprev: |
|
173 | if tiprev > self.tiprev: | |
172 | self.tipnode = cl.node(tiprev) |
|
174 | self.tipnode = cl.node(tiprev) | |
173 | self.tiprev = tiprev |
|
175 | self.tiprev = tiprev |
@@ -1,1139 +1,1140 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 | invalidating branch cache (tip differs) | |||
510 | overwriting a expanding keywords |
|
511 | overwriting a expanding keywords | |
511 | $ hg -q id |
|
512 | $ hg -q id | |
512 | 67d8c481a6be |
|
513 | 67d8c481a6be | |
513 | $ head -1 a |
|
514 | $ head -1 a | |
514 | expand $Id: a,v 67d8c481a6be 1970/01/01 00:00:15 test $ |
|
515 | expand $Id: a,v 67d8c481a6be 1970/01/01 00:00:15 test $ | |
515 |
|
516 | |||
516 | $ hg -q strip -n tip |
|
517 | $ hg -q strip -n tip | |
517 |
|
518 | |||
518 | Test patch queue repo |
|
519 | Test patch queue repo | |
519 |
|
520 | |||
520 | $ hg init --mq |
|
521 | $ hg init --mq | |
521 | $ hg qimport -r tip -n mqtest.diff |
|
522 | $ hg qimport -r tip -n mqtest.diff | |
522 | $ hg commit --mq -m mqtest |
|
523 | $ hg commit --mq -m mqtest | |
523 |
|
524 | |||
524 | Keywords should not be expanded in patch |
|
525 | Keywords should not be expanded in patch | |
525 |
|
526 | |||
526 | $ cat .hg/patches/mqtest.diff |
|
527 | $ cat .hg/patches/mqtest.diff | |
527 | # HG changeset patch |
|
528 | # HG changeset patch | |
528 | # User User Name <user@example.com> |
|
529 | # User User Name <user@example.com> | |
529 | # Date 1 0 |
|
530 | # Date 1 0 | |
530 | # Node ID 40a904bbbe4cd4ab0a1f28411e35db26341a40ad |
|
531 | # Node ID 40a904bbbe4cd4ab0a1f28411e35db26341a40ad | |
531 | # Parent ef63ca68695bc9495032c6fda1350c71e6d256e9 |
|
532 | # Parent ef63ca68695bc9495032c6fda1350c71e6d256e9 | |
532 | cndiff |
|
533 | cndiff | |
533 |
|
534 | |||
534 | diff -r ef63ca68695b -r 40a904bbbe4c c |
|
535 | diff -r ef63ca68695b -r 40a904bbbe4c c | |
535 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
536 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
536 | +++ b/c Thu Jan 01 00:00:01 1970 +0000 |
|
537 | +++ b/c Thu Jan 01 00:00:01 1970 +0000 | |
537 | @@ -0,0 +1,2 @@ |
|
538 | @@ -0,0 +1,2 @@ | |
538 | +$Id$ |
|
539 | +$Id$ | |
539 | +tests for different changenodes |
|
540 | +tests for different changenodes | |
540 |
|
541 | |||
541 | $ hg qpop |
|
542 | $ hg qpop | |
542 | popping mqtest.diff |
|
543 | popping mqtest.diff | |
543 | patch queue now empty |
|
544 | patch queue now empty | |
544 |
|
545 | |||
545 | qgoto, implying qpush, should expand |
|
546 | qgoto, implying qpush, should expand | |
546 |
|
547 | |||
547 | $ hg qgoto mqtest.diff |
|
548 | $ hg qgoto mqtest.diff | |
548 | applying mqtest.diff |
|
549 | applying mqtest.diff | |
549 | now at: mqtest.diff |
|
550 | now at: mqtest.diff | |
550 | $ cat c |
|
551 | $ cat c | |
551 | $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $ |
|
552 | $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $ | |
552 | tests for different changenodes |
|
553 | tests for different changenodes | |
553 | $ hg cat c |
|
554 | $ hg cat c | |
554 | $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $ |
|
555 | $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $ | |
555 | tests for different changenodes |
|
556 | tests for different changenodes | |
556 |
|
557 | |||
557 | Keywords should not be expanded in filelog |
|
558 | Keywords should not be expanded in filelog | |
558 |
|
559 | |||
559 | $ hg --config 'extensions.keyword=!' cat c |
|
560 | $ hg --config 'extensions.keyword=!' cat c | |
560 | $Id$ |
|
561 | $Id$ | |
561 | tests for different changenodes |
|
562 | tests for different changenodes | |
562 |
|
563 | |||
563 | qpop and move on |
|
564 | qpop and move on | |
564 |
|
565 | |||
565 | $ hg qpop |
|
566 | $ hg qpop | |
566 | popping mqtest.diff |
|
567 | popping mqtest.diff | |
567 | patch queue now empty |
|
568 | patch queue now empty | |
568 |
|
569 | |||
569 | Copy and show added kwfiles |
|
570 | Copy and show added kwfiles | |
570 |
|
571 | |||
571 | $ hg cp a c |
|
572 | $ hg cp a c | |
572 | $ hg kwfiles |
|
573 | $ hg kwfiles | |
573 | a |
|
574 | a | |
574 | c |
|
575 | c | |
575 |
|
576 | |||
576 | Commit and show expansion in original and copy |
|
577 | Commit and show expansion in original and copy | |
577 |
|
578 | |||
578 | $ hg --debug commit -ma2c -d '1 0' -u 'User Name <user@example.com>' |
|
579 | $ hg --debug commit -ma2c -d '1 0' -u 'User Name <user@example.com>' | |
579 | c |
|
580 | c | |
580 | c: copy a:0045e12f6c5791aac80ca6cbfd97709a88307292 |
|
581 | c: copy a:0045e12f6c5791aac80ca6cbfd97709a88307292 | |
581 | removing unknown node 40a904bbbe4c from 1-phase boundary |
|
582 | removing unknown node 40a904bbbe4c from 1-phase boundary | |
582 | overwriting c expanding keywords |
|
583 | overwriting c expanding keywords | |
583 | committed changeset 2:25736cf2f5cbe41f6be4e6784ef6ecf9f3bbcc7d |
|
584 | committed changeset 2:25736cf2f5cbe41f6be4e6784ef6ecf9f3bbcc7d | |
584 | $ cat a c |
|
585 | $ cat a c | |
585 | expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $ |
|
586 | expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $ | |
586 | do not process $Id: |
|
587 | do not process $Id: | |
587 | xxx $ |
|
588 | xxx $ | |
588 | expand $Id: c,v 25736cf2f5cb 1970/01/01 00:00:01 user $ |
|
589 | expand $Id: c,v 25736cf2f5cb 1970/01/01 00:00:01 user $ | |
589 | do not process $Id: |
|
590 | do not process $Id: | |
590 | xxx $ |
|
591 | xxx $ | |
591 |
|
592 | |||
592 | Touch copied c and check its status |
|
593 | Touch copied c and check its status | |
593 |
|
594 | |||
594 | $ touch c |
|
595 | $ touch c | |
595 | $ hg status |
|
596 | $ hg status | |
596 |
|
597 | |||
597 | Copy kwfile to keyword ignored file unexpanding keywords |
|
598 | Copy kwfile to keyword ignored file unexpanding keywords | |
598 |
|
599 | |||
599 | $ hg --verbose copy a i |
|
600 | $ hg --verbose copy a i | |
600 | copying a to i |
|
601 | copying a to i | |
601 | overwriting i shrinking keywords |
|
602 | overwriting i shrinking keywords | |
602 | $ head -n 1 i |
|
603 | $ head -n 1 i | |
603 | expand $Id$ |
|
604 | expand $Id$ | |
604 | $ hg forget i |
|
605 | $ hg forget i | |
605 | $ rm i |
|
606 | $ rm i | |
606 |
|
607 | |||
607 | Copy ignored file to ignored file: no overwriting |
|
608 | Copy ignored file to ignored file: no overwriting | |
608 |
|
609 | |||
609 | $ hg --verbose copy b i |
|
610 | $ hg --verbose copy b i | |
610 | copying b to i |
|
611 | copying b to i | |
611 | $ hg forget i |
|
612 | $ hg forget i | |
612 | $ rm i |
|
613 | $ rm i | |
613 |
|
614 | |||
614 | cp symlink file; hg cp -A symlink file (part1) |
|
615 | cp symlink file; hg cp -A symlink file (part1) | |
615 | - copied symlink points to kwfile: overwrite |
|
616 | - copied symlink points to kwfile: overwrite | |
616 |
|
617 | |||
617 | #if symlink |
|
618 | #if symlink | |
618 | $ cp sym i |
|
619 | $ cp sym i | |
619 | $ ls -l i |
|
620 | $ ls -l i | |
620 | -rw-r--r--* (glob) |
|
621 | -rw-r--r--* (glob) | |
621 | $ head -1 i |
|
622 | $ head -1 i | |
622 | expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $ |
|
623 | expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $ | |
623 | $ hg copy --after --verbose sym i |
|
624 | $ hg copy --after --verbose sym i | |
624 | copying sym to i |
|
625 | copying sym to i | |
625 | overwriting i shrinking keywords |
|
626 | overwriting i shrinking keywords | |
626 | $ head -1 i |
|
627 | $ head -1 i | |
627 | expand $Id$ |
|
628 | expand $Id$ | |
628 | $ hg forget i |
|
629 | $ hg forget i | |
629 | $ rm i |
|
630 | $ rm i | |
630 | #endif |
|
631 | #endif | |
631 |
|
632 | |||
632 | Test different options of hg kwfiles |
|
633 | Test different options of hg kwfiles | |
633 |
|
634 | |||
634 | $ hg kwfiles |
|
635 | $ hg kwfiles | |
635 | a |
|
636 | a | |
636 | c |
|
637 | c | |
637 | $ hg -v kwfiles --ignore |
|
638 | $ hg -v kwfiles --ignore | |
638 | I b |
|
639 | I b | |
639 | I sym |
|
640 | I sym | |
640 | $ hg kwfiles --all |
|
641 | $ hg kwfiles --all | |
641 | K a |
|
642 | K a | |
642 | K c |
|
643 | K c | |
643 | I b |
|
644 | I b | |
644 | I sym |
|
645 | I sym | |
645 |
|
646 | |||
646 | Diff specific revision |
|
647 | Diff specific revision | |
647 |
|
648 | |||
648 | $ hg diff --rev 1 |
|
649 | $ hg diff --rev 1 | |
649 | diff -r ef63ca68695b c |
|
650 | diff -r ef63ca68695b c | |
650 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
651 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
651 | +++ b/c * (glob) |
|
652 | +++ b/c * (glob) | |
652 | @@ -0,0 +1,3 @@ |
|
653 | @@ -0,0 +1,3 @@ | |
653 | +expand $Id$ |
|
654 | +expand $Id$ | |
654 | +do not process $Id: |
|
655 | +do not process $Id: | |
655 | +xxx $ |
|
656 | +xxx $ | |
656 |
|
657 | |||
657 | Status after rollback: |
|
658 | Status after rollback: | |
658 |
|
659 | |||
659 | $ hg rollback |
|
660 | $ hg rollback | |
660 | repository tip rolled back to revision 1 (undo commit) |
|
661 | repository tip rolled back to revision 1 (undo commit) | |
661 | working directory now based on revision 1 |
|
662 | working directory now based on revision 1 | |
662 | $ hg status |
|
663 | $ hg status | |
663 | A c |
|
664 | A c | |
664 | $ hg update --clean |
|
665 | $ hg update --clean | |
665 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
666 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
666 |
|
667 | |||
667 | #if symlink |
|
668 | #if symlink | |
668 |
|
669 | |||
669 | cp symlink file; hg cp -A symlink file (part2) |
|
670 | cp symlink file; hg cp -A symlink file (part2) | |
670 | - copied symlink points to kw ignored file: do not overwrite |
|
671 | - copied symlink points to kw ignored file: do not overwrite | |
671 |
|
672 | |||
672 | $ cat a > i |
|
673 | $ cat a > i | |
673 | $ ln -s i symignored |
|
674 | $ ln -s i symignored | |
674 | $ hg commit -Am 'fake expansion in ignored and symlink' i symignored |
|
675 | $ hg commit -Am 'fake expansion in ignored and symlink' i symignored | |
675 | $ cp symignored x |
|
676 | $ cp symignored x | |
676 | $ hg copy --after --verbose symignored x |
|
677 | $ hg copy --after --verbose symignored x | |
677 | copying symignored to x |
|
678 | copying symignored to x | |
678 | $ head -n 1 x |
|
679 | $ head -n 1 x | |
679 | expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $ |
|
680 | expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $ | |
680 | $ hg forget x |
|
681 | $ hg forget x | |
681 | $ rm x |
|
682 | $ rm x | |
682 |
|
683 | |||
683 | $ hg rollback |
|
684 | $ hg rollback | |
684 | repository tip rolled back to revision 1 (undo commit) |
|
685 | repository tip rolled back to revision 1 (undo commit) | |
685 | working directory now based on revision 1 |
|
686 | working directory now based on revision 1 | |
686 | $ hg update --clean |
|
687 | $ hg update --clean | |
687 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
688 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
688 | $ rm i symignored |
|
689 | $ rm i symignored | |
689 |
|
690 | |||
690 | #endif |
|
691 | #endif | |
691 |
|
692 | |||
692 | Custom keywordmaps as argument to kwdemo |
|
693 | Custom keywordmaps as argument to kwdemo | |
693 |
|
694 | |||
694 | $ hg --quiet kwdemo "Xinfo = {author}: {desc}" |
|
695 | $ hg --quiet kwdemo "Xinfo = {author}: {desc}" | |
695 | [extensions] |
|
696 | [extensions] | |
696 | keyword = |
|
697 | keyword = | |
697 | [keyword] |
|
698 | [keyword] | |
698 | ** = |
|
699 | ** = | |
699 | b = ignore |
|
700 | b = ignore | |
700 | demo.txt = |
|
701 | demo.txt = | |
701 | i = ignore |
|
702 | i = ignore | |
702 | [keywordset] |
|
703 | [keywordset] | |
703 | svn = False |
|
704 | svn = False | |
704 | [keywordmaps] |
|
705 | [keywordmaps] | |
705 | Xinfo = {author}: {desc} |
|
706 | Xinfo = {author}: {desc} | |
706 | $Xinfo: test: hg keyword configuration and expansion example $ |
|
707 | $Xinfo: test: hg keyword configuration and expansion example $ | |
707 |
|
708 | |||
708 | Configure custom keywordmaps |
|
709 | Configure custom keywordmaps | |
709 |
|
710 | |||
710 | $ cat <<EOF >>$HGRCPATH |
|
711 | $ cat <<EOF >>$HGRCPATH | |
711 | > [keywordmaps] |
|
712 | > [keywordmaps] | |
712 | > Id = {file} {node|short} {date|rfc822date} {author|user} |
|
713 | > Id = {file} {node|short} {date|rfc822date} {author|user} | |
713 | > Xinfo = {author}: {desc} |
|
714 | > Xinfo = {author}: {desc} | |
714 | > EOF |
|
715 | > EOF | |
715 |
|
716 | |||
716 | Cat and hg cat files before custom expansion |
|
717 | Cat and hg cat files before custom expansion | |
717 |
|
718 | |||
718 | $ cat a b |
|
719 | $ cat a b | |
719 | expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $ |
|
720 | expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $ | |
720 | do not process $Id: |
|
721 | do not process $Id: | |
721 | xxx $ |
|
722 | xxx $ | |
722 | ignore $Id$ |
|
723 | ignore $Id$ | |
723 | $ hg cat sym a b && echo |
|
724 | $ hg cat sym a b && echo | |
724 | expand $Id: a ef63ca68695b Thu, 01 Jan 1970 00:00:00 +0000 user $ |
|
725 | expand $Id: a ef63ca68695b Thu, 01 Jan 1970 00:00:00 +0000 user $ | |
725 | do not process $Id: |
|
726 | do not process $Id: | |
726 | xxx $ |
|
727 | xxx $ | |
727 | ignore $Id$ |
|
728 | ignore $Id$ | |
728 | a |
|
729 | a | |
729 |
|
730 | |||
730 | Write custom keyword and prepare multi-line commit message |
|
731 | Write custom keyword and prepare multi-line commit message | |
731 |
|
732 | |||
732 | $ echo '$Xinfo$' >> a |
|
733 | $ echo '$Xinfo$' >> a | |
733 | $ cat <<EOF >> log |
|
734 | $ cat <<EOF >> log | |
734 | > firstline |
|
735 | > firstline | |
735 | > secondline |
|
736 | > secondline | |
736 | > EOF |
|
737 | > EOF | |
737 |
|
738 | |||
738 | Interrupted commit should not change state |
|
739 | Interrupted commit should not change state | |
739 |
|
740 | |||
740 | $ hg commit |
|
741 | $ hg commit | |
741 | abort: empty commit message |
|
742 | abort: empty commit message | |
742 | [255] |
|
743 | [255] | |
743 | $ hg status |
|
744 | $ hg status | |
744 | M a |
|
745 | M a | |
745 | ? c |
|
746 | ? c | |
746 | ? log |
|
747 | ? log | |
747 |
|
748 | |||
748 | Commit with multi-line message and custom expansion |
|
749 | Commit with multi-line message and custom expansion | |
749 |
|
750 | |||
750 | $ hg --debug commit -l log -d '2 0' -u 'User Name <user@example.com>' |
|
751 | $ hg --debug commit -l log -d '2 0' -u 'User Name <user@example.com>' | |
751 | a |
|
752 | a | |
752 | removing unknown node 40a904bbbe4c from 1-phase boundary |
|
753 | removing unknown node 40a904bbbe4c from 1-phase boundary | |
753 | overwriting a expanding keywords |
|
754 | overwriting a expanding keywords | |
754 | committed changeset 2:bb948857c743469b22bbf51f7ec8112279ca5d83 |
|
755 | committed changeset 2:bb948857c743469b22bbf51f7ec8112279ca5d83 | |
755 | $ rm log |
|
756 | $ rm log | |
756 |
|
757 | |||
757 | Stat, verify and show custom expansion (firstline) |
|
758 | Stat, verify and show custom expansion (firstline) | |
758 |
|
759 | |||
759 | $ hg status |
|
760 | $ hg status | |
760 | ? c |
|
761 | ? c | |
761 | $ hg verify |
|
762 | $ hg verify | |
762 | checking changesets |
|
763 | checking changesets | |
763 | checking manifests |
|
764 | checking manifests | |
764 | crosschecking files in changesets and manifests |
|
765 | crosschecking files in changesets and manifests | |
765 | checking files |
|
766 | checking files | |
766 | 3 files, 3 changesets, 4 total revisions |
|
767 | 3 files, 3 changesets, 4 total revisions | |
767 | $ cat a b |
|
768 | $ cat a b | |
768 | expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $ |
|
769 | expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $ | |
769 | do not process $Id: |
|
770 | do not process $Id: | |
770 | xxx $ |
|
771 | xxx $ | |
771 | $Xinfo: User Name <user@example.com>: firstline $ |
|
772 | $Xinfo: User Name <user@example.com>: firstline $ | |
772 | ignore $Id$ |
|
773 | ignore $Id$ | |
773 | $ hg cat sym a b && echo |
|
774 | $ hg cat sym a b && echo | |
774 | expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $ |
|
775 | expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $ | |
775 | do not process $Id: |
|
776 | do not process $Id: | |
776 | xxx $ |
|
777 | xxx $ | |
777 | $Xinfo: User Name <user@example.com>: firstline $ |
|
778 | $Xinfo: User Name <user@example.com>: firstline $ | |
778 | ignore $Id$ |
|
779 | ignore $Id$ | |
779 | a |
|
780 | a | |
780 |
|
781 | |||
781 | annotate |
|
782 | annotate | |
782 |
|
783 | |||
783 | $ hg annotate a |
|
784 | $ hg annotate a | |
784 | 1: expand $Id$ |
|
785 | 1: expand $Id$ | |
785 | 1: do not process $Id: |
|
786 | 1: do not process $Id: | |
786 | 1: xxx $ |
|
787 | 1: xxx $ | |
787 | 2: $Xinfo$ |
|
788 | 2: $Xinfo$ | |
788 |
|
789 | |||
789 | remove with status checks |
|
790 | remove with status checks | |
790 |
|
791 | |||
791 | $ hg debugrebuildstate |
|
792 | $ hg debugrebuildstate | |
792 | $ hg remove a |
|
793 | $ hg remove a | |
793 | $ hg --debug commit -m rma |
|
794 | $ hg --debug commit -m rma | |
794 | committed changeset 3:d14c712653769de926994cf7fbb06c8fbd68f012 |
|
795 | committed changeset 3:d14c712653769de926994cf7fbb06c8fbd68f012 | |
795 | $ hg status |
|
796 | $ hg status | |
796 | ? c |
|
797 | ? c | |
797 |
|
798 | |||
798 | Rollback, revert, and check expansion |
|
799 | Rollback, revert, and check expansion | |
799 |
|
800 | |||
800 | $ hg rollback |
|
801 | $ hg rollback | |
801 | repository tip rolled back to revision 2 (undo commit) |
|
802 | repository tip rolled back to revision 2 (undo commit) | |
802 | working directory now based on revision 2 |
|
803 | working directory now based on revision 2 | |
803 | $ hg status |
|
804 | $ hg status | |
804 | R a |
|
805 | R a | |
805 | ? c |
|
806 | ? c | |
806 | $ hg revert --no-backup --rev tip a |
|
807 | $ hg revert --no-backup --rev tip a | |
807 | $ cat a |
|
808 | $ cat a | |
808 | expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $ |
|
809 | expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $ | |
809 | do not process $Id: |
|
810 | do not process $Id: | |
810 | xxx $ |
|
811 | xxx $ | |
811 | $Xinfo: User Name <user@example.com>: firstline $ |
|
812 | $Xinfo: User Name <user@example.com>: firstline $ | |
812 |
|
813 | |||
813 | Clone to test global and local configurations |
|
814 | Clone to test global and local configurations | |
814 |
|
815 | |||
815 | $ cd .. |
|
816 | $ cd .. | |
816 |
|
817 | |||
817 | Expansion in destination with global configuration |
|
818 | Expansion in destination with global configuration | |
818 |
|
819 | |||
819 | $ hg --quiet clone Test globalconf |
|
820 | $ hg --quiet clone Test globalconf | |
820 | $ cat globalconf/a |
|
821 | $ cat globalconf/a | |
821 | expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $ |
|
822 | expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $ | |
822 | do not process $Id: |
|
823 | do not process $Id: | |
823 | xxx $ |
|
824 | xxx $ | |
824 | $Xinfo: User Name <user@example.com>: firstline $ |
|
825 | $Xinfo: User Name <user@example.com>: firstline $ | |
825 |
|
826 | |||
826 | No expansion in destination with local configuration in origin only |
|
827 | No expansion in destination with local configuration in origin only | |
827 |
|
828 | |||
828 | $ hg --quiet --config 'keyword.**=ignore' clone Test localconf |
|
829 | $ hg --quiet --config 'keyword.**=ignore' clone Test localconf | |
829 | $ cat localconf/a |
|
830 | $ cat localconf/a | |
830 | expand $Id$ |
|
831 | expand $Id$ | |
831 | do not process $Id: |
|
832 | do not process $Id: | |
832 | xxx $ |
|
833 | xxx $ | |
833 | $Xinfo$ |
|
834 | $Xinfo$ | |
834 |
|
835 | |||
835 | Clone to test incoming |
|
836 | Clone to test incoming | |
836 |
|
837 | |||
837 | $ hg clone -r1 Test Test-a |
|
838 | $ hg clone -r1 Test Test-a | |
838 | adding changesets |
|
839 | adding changesets | |
839 | adding manifests |
|
840 | adding manifests | |
840 | adding file changes |
|
841 | adding file changes | |
841 | added 2 changesets with 3 changes to 3 files |
|
842 | added 2 changesets with 3 changes to 3 files | |
842 | updating to branch default |
|
843 | updating to branch default | |
843 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
844 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
844 | $ cd Test-a |
|
845 | $ cd Test-a | |
845 | $ cat <<EOF >> .hg/hgrc |
|
846 | $ cat <<EOF >> .hg/hgrc | |
846 | > [paths] |
|
847 | > [paths] | |
847 | > default = ../Test |
|
848 | > default = ../Test | |
848 | > EOF |
|
849 | > EOF | |
849 | $ hg incoming |
|
850 | $ hg incoming | |
850 | comparing with $TESTTMP/Test (glob) |
|
851 | comparing with $TESTTMP/Test (glob) | |
851 | searching for changes |
|
852 | searching for changes | |
852 | changeset: 2:bb948857c743 |
|
853 | changeset: 2:bb948857c743 | |
853 | tag: tip |
|
854 | tag: tip | |
854 | user: User Name <user@example.com> |
|
855 | user: User Name <user@example.com> | |
855 | date: Thu Jan 01 00:00:02 1970 +0000 |
|
856 | date: Thu Jan 01 00:00:02 1970 +0000 | |
856 | summary: firstline |
|
857 | summary: firstline | |
857 |
|
858 | |||
858 | Imported patch should not be rejected |
|
859 | Imported patch should not be rejected | |
859 |
|
860 | |||
860 | >>> import re |
|
861 | >>> import re | |
861 | >>> text = re.sub(r'(Id.*)', r'\1 rejecttest', open('a').read()) |
|
862 | >>> text = re.sub(r'(Id.*)', r'\1 rejecttest', open('a').read()) | |
862 | >>> open('a', 'wb').write(text) |
|
863 | >>> open('a', 'wb').write(text) | |
863 | $ hg --debug commit -m'rejects?' -d '3 0' -u 'User Name <user@example.com>' |
|
864 | $ hg --debug commit -m'rejects?' -d '3 0' -u 'User Name <user@example.com>' | |
864 | a |
|
865 | a | |
865 | overwriting a expanding keywords |
|
866 | overwriting a expanding keywords | |
866 | committed changeset 2:85e279d709ffc28c9fdd1b868570985fc3d87082 |
|
867 | committed changeset 2:85e279d709ffc28c9fdd1b868570985fc3d87082 | |
867 | $ hg export -o ../rejecttest.diff tip |
|
868 | $ hg export -o ../rejecttest.diff tip | |
868 | $ cd ../Test |
|
869 | $ cd ../Test | |
869 | $ hg import ../rejecttest.diff |
|
870 | $ hg import ../rejecttest.diff | |
870 | applying ../rejecttest.diff |
|
871 | applying ../rejecttest.diff | |
871 | $ cat a b |
|
872 | $ cat a b | |
872 | expand $Id: a 4e0994474d25 Thu, 01 Jan 1970 00:00:03 +0000 user $ rejecttest |
|
873 | expand $Id: a 4e0994474d25 Thu, 01 Jan 1970 00:00:03 +0000 user $ rejecttest | |
873 | do not process $Id: rejecttest |
|
874 | do not process $Id: rejecttest | |
874 | xxx $ |
|
875 | xxx $ | |
875 | $Xinfo: User Name <user@example.com>: rejects? $ |
|
876 | $Xinfo: User Name <user@example.com>: rejects? $ | |
876 | ignore $Id$ |
|
877 | ignore $Id$ | |
877 |
|
878 | |||
878 | $ hg rollback |
|
879 | $ hg rollback | |
879 | repository tip rolled back to revision 2 (undo import) |
|
880 | repository tip rolled back to revision 2 (undo import) | |
880 | working directory now based on revision 2 |
|
881 | working directory now based on revision 2 | |
881 | $ hg update --clean |
|
882 | $ hg update --clean | |
882 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
883 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
883 |
|
884 | |||
884 | kwexpand/kwshrink on selected files |
|
885 | kwexpand/kwshrink on selected files | |
885 |
|
886 | |||
886 | $ mkdir x |
|
887 | $ mkdir x | |
887 | $ hg copy a x/a |
|
888 | $ hg copy a x/a | |
888 | $ hg --verbose kwshrink a |
|
889 | $ hg --verbose kwshrink a | |
889 | overwriting a shrinking keywords |
|
890 | overwriting a shrinking keywords | |
890 | - sleep required for dirstate.normal() check |
|
891 | - sleep required for dirstate.normal() check | |
891 | $ sleep 1 |
|
892 | $ sleep 1 | |
892 | $ hg status a |
|
893 | $ hg status a | |
893 | $ hg --verbose kwexpand a |
|
894 | $ hg --verbose kwexpand a | |
894 | overwriting a expanding keywords |
|
895 | overwriting a expanding keywords | |
895 | $ hg status a |
|
896 | $ hg status a | |
896 |
|
897 | |||
897 | kwexpand x/a should abort |
|
898 | kwexpand x/a should abort | |
898 |
|
899 | |||
899 | $ hg --verbose kwexpand x/a |
|
900 | $ hg --verbose kwexpand x/a | |
900 | abort: outstanding uncommitted changes |
|
901 | abort: outstanding uncommitted changes | |
901 | [255] |
|
902 | [255] | |
902 | $ cd x |
|
903 | $ cd x | |
903 | $ hg --debug commit -m xa -d '3 0' -u 'User Name <user@example.com>' |
|
904 | $ hg --debug commit -m xa -d '3 0' -u 'User Name <user@example.com>' | |
904 | x/a |
|
905 | x/a | |
905 | x/a: copy a:779c764182ce5d43e2b1eb66ce06d7b47bfe342e |
|
906 | x/a: copy a:779c764182ce5d43e2b1eb66ce06d7b47bfe342e | |
906 | overwriting x/a expanding keywords |
|
907 | overwriting x/a expanding keywords | |
907 | committed changeset 3:b4560182a3f9a358179fd2d835c15e9da379c1e4 |
|
908 | committed changeset 3:b4560182a3f9a358179fd2d835c15e9da379c1e4 | |
908 | $ cat a |
|
909 | $ cat a | |
909 | expand $Id: x/a b4560182a3f9 Thu, 01 Jan 1970 00:00:03 +0000 user $ |
|
910 | expand $Id: x/a b4560182a3f9 Thu, 01 Jan 1970 00:00:03 +0000 user $ | |
910 | do not process $Id: |
|
911 | do not process $Id: | |
911 | xxx $ |
|
912 | xxx $ | |
912 | $Xinfo: User Name <user@example.com>: xa $ |
|
913 | $Xinfo: User Name <user@example.com>: xa $ | |
913 |
|
914 | |||
914 | kwshrink a inside directory x |
|
915 | kwshrink a inside directory x | |
915 |
|
916 | |||
916 | $ hg --verbose kwshrink a |
|
917 | $ hg --verbose kwshrink a | |
917 | overwriting x/a shrinking keywords |
|
918 | overwriting x/a shrinking keywords | |
918 | $ cat a |
|
919 | $ cat a | |
919 | expand $Id$ |
|
920 | expand $Id$ | |
920 | do not process $Id: |
|
921 | do not process $Id: | |
921 | xxx $ |
|
922 | xxx $ | |
922 | $Xinfo$ |
|
923 | $Xinfo$ | |
923 | $ cd .. |
|
924 | $ cd .. | |
924 |
|
925 | |||
925 | kwexpand nonexistent |
|
926 | kwexpand nonexistent | |
926 |
|
927 | |||
927 | $ hg kwexpand nonexistent |
|
928 | $ hg kwexpand nonexistent | |
928 | nonexistent:* (glob) |
|
929 | nonexistent:* (glob) | |
929 |
|
930 | |||
930 |
|
931 | |||
931 | #if serve |
|
932 | #if serve | |
932 | hg serve |
|
933 | hg serve | |
933 | - expand with hgweb file |
|
934 | - expand with hgweb file | |
934 | - no expansion with hgweb annotate/changeset/filediff |
|
935 | - no expansion with hgweb annotate/changeset/filediff | |
935 | - check errors |
|
936 | - check errors | |
936 |
|
937 | |||
937 | $ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log |
|
938 | $ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log | |
938 | $ cat hg.pid >> $DAEMON_PIDS |
|
939 | $ cat hg.pid >> $DAEMON_PIDS | |
939 | $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT 'file/tip/a/?style=raw' |
|
940 | $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT 'file/tip/a/?style=raw' | |
940 | 200 Script output follows |
|
941 | 200 Script output follows | |
941 |
|
942 | |||
942 | expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $ |
|
943 | expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $ | |
943 | do not process $Id: |
|
944 | do not process $Id: | |
944 | xxx $ |
|
945 | xxx $ | |
945 | $Xinfo: User Name <user@example.com>: firstline $ |
|
946 | $Xinfo: User Name <user@example.com>: firstline $ | |
946 | $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT 'annotate/tip/a/?style=raw' |
|
947 | $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT 'annotate/tip/a/?style=raw' | |
947 | 200 Script output follows |
|
948 | 200 Script output follows | |
948 |
|
949 | |||
949 |
|
950 | |||
950 | user@1: expand $Id$ |
|
951 | user@1: expand $Id$ | |
951 | user@1: do not process $Id: |
|
952 | user@1: do not process $Id: | |
952 | user@1: xxx $ |
|
953 | user@1: xxx $ | |
953 | user@2: $Xinfo$ |
|
954 | user@2: $Xinfo$ | |
954 |
|
955 | |||
955 |
|
956 | |||
956 |
|
957 | |||
957 |
|
958 | |||
958 | $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT 'rev/tip/?style=raw' |
|
959 | $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT 'rev/tip/?style=raw' | |
959 | 200 Script output follows |
|
960 | 200 Script output follows | |
960 |
|
961 | |||
961 |
|
962 | |||
962 | # HG changeset patch |
|
963 | # HG changeset patch | |
963 | # User User Name <user@example.com> |
|
964 | # User User Name <user@example.com> | |
964 | # Date 3 0 |
|
965 | # Date 3 0 | |
965 | # Node ID b4560182a3f9a358179fd2d835c15e9da379c1e4 |
|
966 | # Node ID b4560182a3f9a358179fd2d835c15e9da379c1e4 | |
966 | # Parent bb948857c743469b22bbf51f7ec8112279ca5d83 |
|
967 | # Parent bb948857c743469b22bbf51f7ec8112279ca5d83 | |
967 | xa |
|
968 | xa | |
968 |
|
969 | |||
969 | diff -r bb948857c743 -r b4560182a3f9 x/a |
|
970 | diff -r bb948857c743 -r b4560182a3f9 x/a | |
970 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
971 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
971 | +++ b/x/a Thu Jan 01 00:00:03 1970 +0000 |
|
972 | +++ b/x/a Thu Jan 01 00:00:03 1970 +0000 | |
972 | @@ -0,0 +1,4 @@ |
|
973 | @@ -0,0 +1,4 @@ | |
973 | +expand $Id$ |
|
974 | +expand $Id$ | |
974 | +do not process $Id: |
|
975 | +do not process $Id: | |
975 | +xxx $ |
|
976 | +xxx $ | |
976 | +$Xinfo$ |
|
977 | +$Xinfo$ | |
977 |
|
978 | |||
978 | $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT 'diff/bb948857c743/a?style=raw' |
|
979 | $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT 'diff/bb948857c743/a?style=raw' | |
979 | 200 Script output follows |
|
980 | 200 Script output follows | |
980 |
|
981 | |||
981 |
|
982 | |||
982 | diff -r ef63ca68695b -r bb948857c743 a |
|
983 | diff -r ef63ca68695b -r bb948857c743 a | |
983 | --- a/a Thu Jan 01 00:00:00 1970 +0000 |
|
984 | --- a/a Thu Jan 01 00:00:00 1970 +0000 | |
984 | +++ b/a Thu Jan 01 00:00:02 1970 +0000 |
|
985 | +++ b/a Thu Jan 01 00:00:02 1970 +0000 | |
985 | @@ -1,3 +1,4 @@ |
|
986 | @@ -1,3 +1,4 @@ | |
986 | expand $Id$ |
|
987 | expand $Id$ | |
987 | do not process $Id: |
|
988 | do not process $Id: | |
988 | xxx $ |
|
989 | xxx $ | |
989 | +$Xinfo$ |
|
990 | +$Xinfo$ | |
990 |
|
991 | |||
991 |
|
992 | |||
992 |
|
993 | |||
993 |
|
994 | |||
994 | $ cat errors.log |
|
995 | $ cat errors.log | |
995 | #endif |
|
996 | #endif | |
996 |
|
997 | |||
997 | Prepare merge and resolve tests |
|
998 | Prepare merge and resolve tests | |
998 |
|
999 | |||
999 | $ echo '$Id$' > m |
|
1000 | $ echo '$Id$' > m | |
1000 | $ hg add m |
|
1001 | $ hg add m | |
1001 | $ hg commit -m 4kw |
|
1002 | $ hg commit -m 4kw | |
1002 | $ echo foo >> m |
|
1003 | $ echo foo >> m | |
1003 | $ hg commit -m 5foo |
|
1004 | $ hg commit -m 5foo | |
1004 |
|
1005 | |||
1005 | simplemerge |
|
1006 | simplemerge | |
1006 |
|
1007 | |||
1007 | $ hg update 4 |
|
1008 | $ hg update 4 | |
1008 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1009 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
1009 | $ echo foo >> m |
|
1010 | $ echo foo >> m | |
1010 | $ hg commit -m 6foo |
|
1011 | $ hg commit -m 6foo | |
1011 | created new head |
|
1012 | created new head | |
1012 | $ hg merge |
|
1013 | $ hg merge | |
1013 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1014 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
1014 | (branch merge, don't forget to commit) |
|
1015 | (branch merge, don't forget to commit) | |
1015 | $ hg commit -m simplemerge |
|
1016 | $ hg commit -m simplemerge | |
1016 | $ cat m |
|
1017 | $ cat m | |
1017 | $Id: m 27d48ee14f67 Thu, 01 Jan 1970 00:00:00 +0000 test $ |
|
1018 | $Id: m 27d48ee14f67 Thu, 01 Jan 1970 00:00:00 +0000 test $ | |
1018 | foo |
|
1019 | foo | |
1019 |
|
1020 | |||
1020 | conflict: keyword should stay outside conflict zone |
|
1021 | conflict: keyword should stay outside conflict zone | |
1021 |
|
1022 | |||
1022 | $ hg update 4 |
|
1023 | $ hg update 4 | |
1023 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1024 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
1024 | $ echo bar >> m |
|
1025 | $ echo bar >> m | |
1025 | $ hg commit -m 8bar |
|
1026 | $ hg commit -m 8bar | |
1026 | created new head |
|
1027 | created new head | |
1027 | $ hg merge |
|
1028 | $ hg merge | |
1028 | merging m |
|
1029 | merging m | |
1029 | warning: conflicts during merge. |
|
1030 | warning: conflicts during merge. | |
1030 | merging m incomplete! (edit conflicts, then use 'hg resolve --mark') |
|
1031 | merging m incomplete! (edit conflicts, then use 'hg resolve --mark') | |
1031 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
1032 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved | |
1032 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
1033 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon | |
1033 | [1] |
|
1034 | [1] | |
1034 | $ cat m |
|
1035 | $ cat m | |
1035 | $Id$ |
|
1036 | $Id$ | |
1036 | <<<<<<< local |
|
1037 | <<<<<<< local | |
1037 | bar |
|
1038 | bar | |
1038 | ======= |
|
1039 | ======= | |
1039 | foo |
|
1040 | foo | |
1040 | >>>>>>> other |
|
1041 | >>>>>>> other | |
1041 |
|
1042 | |||
1042 | resolve to local |
|
1043 | resolve to local | |
1043 |
|
1044 | |||
1044 | $ HGMERGE=internal:local hg resolve -a |
|
1045 | $ HGMERGE=internal:local hg resolve -a | |
1045 | $ hg commit -m localresolve |
|
1046 | $ hg commit -m localresolve | |
1046 | $ cat m |
|
1047 | $ cat m | |
1047 | $Id: m 800511b3a22d Thu, 01 Jan 1970 00:00:00 +0000 test $ |
|
1048 | $Id: m 800511b3a22d Thu, 01 Jan 1970 00:00:00 +0000 test $ | |
1048 | bar |
|
1049 | bar | |
1049 |
|
1050 | |||
1050 | Test restricted mode with transplant -b |
|
1051 | Test restricted mode with transplant -b | |
1051 |
|
1052 | |||
1052 | $ hg update 6 |
|
1053 | $ hg update 6 | |
1053 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1054 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
1054 | $ hg branch foo |
|
1055 | $ hg branch foo | |
1055 | marked working directory as branch foo |
|
1056 | marked working directory as branch foo | |
1056 | (branches are permanent and global, did you want a bookmark?) |
|
1057 | (branches are permanent and global, did you want a bookmark?) | |
1057 | $ mv a a.bak |
|
1058 | $ mv a a.bak | |
1058 | $ echo foobranch > a |
|
1059 | $ echo foobranch > a | |
1059 | $ cat a.bak >> a |
|
1060 | $ cat a.bak >> a | |
1060 | $ rm a.bak |
|
1061 | $ rm a.bak | |
1061 | $ hg commit -m 9foobranch |
|
1062 | $ hg commit -m 9foobranch | |
1062 | $ hg update default |
|
1063 | $ hg update default | |
1063 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1064 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
1064 | $ hg -y transplant -b foo tip |
|
1065 | $ hg -y transplant -b foo tip | |
1065 | applying 4aa30d025d50 |
|
1066 | applying 4aa30d025d50 | |
1066 | 4aa30d025d50 transplanted to e00abbf63521 |
|
1067 | 4aa30d025d50 transplanted to e00abbf63521 | |
1067 |
|
1068 | |||
1068 | Expansion in changeset but not in file |
|
1069 | Expansion in changeset but not in file | |
1069 |
|
1070 | |||
1070 | $ hg tip -p |
|
1071 | $ hg tip -p | |
1071 | changeset: 11:e00abbf63521 |
|
1072 | changeset: 11:e00abbf63521 | |
1072 | tag: tip |
|
1073 | tag: tip | |
1073 | parent: 9:800511b3a22d |
|
1074 | parent: 9:800511b3a22d | |
1074 | user: test |
|
1075 | user: test | |
1075 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1076 | date: Thu Jan 01 00:00:00 1970 +0000 | |
1076 | summary: 9foobranch |
|
1077 | summary: 9foobranch | |
1077 |
|
1078 | |||
1078 | diff -r 800511b3a22d -r e00abbf63521 a |
|
1079 | diff -r 800511b3a22d -r e00abbf63521 a | |
1079 | --- a/a Thu Jan 01 00:00:00 1970 +0000 |
|
1080 | --- a/a Thu Jan 01 00:00:00 1970 +0000 | |
1080 | +++ b/a Thu Jan 01 00:00:00 1970 +0000 |
|
1081 | +++ b/a Thu Jan 01 00:00:00 1970 +0000 | |
1081 | @@ -1,3 +1,4 @@ |
|
1082 | @@ -1,3 +1,4 @@ | |
1082 | +foobranch |
|
1083 | +foobranch | |
1083 | expand $Id$ |
|
1084 | expand $Id$ | |
1084 | do not process $Id: |
|
1085 | do not process $Id: | |
1085 | xxx $ |
|
1086 | xxx $ | |
1086 |
|
1087 | |||
1087 | $ head -n 2 a |
|
1088 | $ head -n 2 a | |
1088 | foobranch |
|
1089 | foobranch | |
1089 | expand $Id: a e00abbf63521 Thu, 01 Jan 1970 00:00:00 +0000 test $ |
|
1090 | expand $Id: a e00abbf63521 Thu, 01 Jan 1970 00:00:00 +0000 test $ | |
1090 |
|
1091 | |||
1091 | Turn off expansion |
|
1092 | Turn off expansion | |
1092 |
|
1093 | |||
1093 | $ hg -q rollback |
|
1094 | $ hg -q rollback | |
1094 | $ hg -q update -C |
|
1095 | $ hg -q update -C | |
1095 |
|
1096 | |||
1096 | kwshrink with unknown file u |
|
1097 | kwshrink with unknown file u | |
1097 |
|
1098 | |||
1098 | $ cp a u |
|
1099 | $ cp a u | |
1099 | $ hg --verbose kwshrink |
|
1100 | $ hg --verbose kwshrink | |
1100 | overwriting a shrinking keywords |
|
1101 | overwriting a shrinking keywords | |
1101 | overwriting m shrinking keywords |
|
1102 | overwriting m shrinking keywords | |
1102 | overwriting x/a shrinking keywords |
|
1103 | overwriting x/a shrinking keywords | |
1103 |
|
1104 | |||
1104 | Keywords shrunk in working directory, but not yet disabled |
|
1105 | Keywords shrunk in working directory, but not yet disabled | |
1105 | - cat shows unexpanded keywords |
|
1106 | - cat shows unexpanded keywords | |
1106 | - hg cat shows expanded keywords |
|
1107 | - hg cat shows expanded keywords | |
1107 |
|
1108 | |||
1108 | $ cat a b |
|
1109 | $ cat a b | |
1109 | expand $Id$ |
|
1110 | expand $Id$ | |
1110 | do not process $Id: |
|
1111 | do not process $Id: | |
1111 | xxx $ |
|
1112 | xxx $ | |
1112 | $Xinfo$ |
|
1113 | $Xinfo$ | |
1113 | ignore $Id$ |
|
1114 | ignore $Id$ | |
1114 | $ hg cat sym a b && echo |
|
1115 | $ hg cat sym a b && echo | |
1115 | expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $ |
|
1116 | expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $ | |
1116 | do not process $Id: |
|
1117 | do not process $Id: | |
1117 | xxx $ |
|
1118 | xxx $ | |
1118 | $Xinfo: User Name <user@example.com>: firstline $ |
|
1119 | $Xinfo: User Name <user@example.com>: firstline $ | |
1119 | ignore $Id$ |
|
1120 | ignore $Id$ | |
1120 | a |
|
1121 | a | |
1121 |
|
1122 | |||
1122 | Now disable keyword expansion |
|
1123 | Now disable keyword expansion | |
1123 |
|
1124 | |||
1124 | $ rm "$HGRCPATH" |
|
1125 | $ rm "$HGRCPATH" | |
1125 | $ cat a b |
|
1126 | $ cat a b | |
1126 | expand $Id$ |
|
1127 | expand $Id$ | |
1127 | do not process $Id: |
|
1128 | do not process $Id: | |
1128 | xxx $ |
|
1129 | xxx $ | |
1129 | $Xinfo$ |
|
1130 | $Xinfo$ | |
1130 | ignore $Id$ |
|
1131 | ignore $Id$ | |
1131 | $ hg cat sym a b && echo |
|
1132 | $ hg cat sym a b && echo | |
1132 | expand $Id$ |
|
1133 | expand $Id$ | |
1133 | do not process $Id: |
|
1134 | do not process $Id: | |
1134 | xxx $ |
|
1135 | xxx $ | |
1135 | $Xinfo$ |
|
1136 | $Xinfo$ | |
1136 | ignore $Id$ |
|
1137 | ignore $Id$ | |
1137 | a |
|
1138 | a | |
1138 |
|
1139 | |||
1139 | $ cd .. |
|
1140 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now