Show More
@@ -67,8 +67,14 b' def _rootctx(repo):' | |||||
67 | def buildmetadata(ctx): |
|
67 | def buildmetadata(ctx): | |
68 | '''build content of .hg_archival.txt''' |
|
68 | '''build content of .hg_archival.txt''' | |
69 | repo = ctx.repo() |
|
69 | repo = ctx.repo() | |
|
70 | hex = ctx.hex() | |||
|
71 | if ctx.rev() is None: | |||
|
72 | hex = ctx.p1().hex() | |||
|
73 | if ctx.dirty(): | |||
|
74 | hex += '+' | |||
|
75 | ||||
70 | base = 'repo: %s\nnode: %s\nbranch: %s\n' % ( |
|
76 | base = 'repo: %s\nnode: %s\nbranch: %s\n' % ( | |
71 |
_rootctx(repo).hex(), |
|
77 | _rootctx(repo).hex(), hex, encoding.fromlocal(ctx.branch())) | |
72 |
|
78 | |||
73 | tags = ''.join('tag: %s\n' % t for t in ctx.tags() |
|
79 | tags = ''.join('tag: %s\n' % t for t in ctx.tags() | |
74 | if repo.tagtype(t) == 'global') |
|
80 | if repo.tagtype(t) == 'global') |
@@ -187,6 +187,14 b' Archive wdir() with subrepos' | |||||
187 | ../wdir/sub1/sub2/folder/test.txt |
|
187 | ../wdir/sub1/sub2/folder/test.txt | |
188 | ../wdir/sub1/sub2/sub2 |
|
188 | ../wdir/sub1/sub2/sub2 | |
189 |
|
189 | |||
|
190 | $ cat ../wdir/.hg_archival.txt | |||
|
191 | repo: 7f491f53a367861f47ee64a80eb997d1f341b77a | |||
|
192 | node: 9bb10eebee29dc0f1201dcf5977b811a540255fd+ | |||
|
193 | branch: default | |||
|
194 | latesttag: null | |||
|
195 | latesttagdistance: 4 | |||
|
196 | changessincelatesttag: 3 | |||
|
197 | ||||
190 | Attempting to archive 'wdir()' with a missing file is handled gracefully |
|
198 | Attempting to archive 'wdir()' with a missing file is handled gracefully | |
191 | $ rm sub1/sub1 |
|
199 | $ rm sub1/sub1 | |
192 | $ rm -r ../wdir |
|
200 | $ rm -r ../wdir | |
@@ -204,6 +212,16 b" Attempting to archive 'wdir()' with a mi" | |||||
204 |
|
212 | |||
205 | Continue relative path printing + subrepos |
|
213 | Continue relative path printing + subrepos | |
206 | $ hg update -Cq |
|
214 | $ hg update -Cq | |
|
215 | $ rm -r ../wdir | |||
|
216 | $ hg archive -S -r 'wdir()' ../wdir | |||
|
217 | $ cat ../wdir/.hg_archival.txt | |||
|
218 | repo: 7f491f53a367861f47ee64a80eb997d1f341b77a | |||
|
219 | node: 9bb10eebee29dc0f1201dcf5977b811a540255fd | |||
|
220 | branch: default | |||
|
221 | latesttag: null | |||
|
222 | latesttagdistance: 4 | |||
|
223 | changessincelatesttag: 3 | |||
|
224 | ||||
207 | $ touch sub1/sub2/folder/bar |
|
225 | $ touch sub1/sub2/folder/bar | |
208 | $ hg addremove sub1/sub2 |
|
226 | $ hg addremove sub1/sub2 | |
209 | adding sub1/sub2/folder/bar (glob) |
|
227 | adding sub1/sub2/folder/bar (glob) |
General Comments 0
You need to be logged in to leave comments.
Login now