##// END OF EJS Templates
bookmarks: Use dirstate to determine the current node in addchangegroup...
David Soria Parra -
r7316:97370416 default
parent child Browse files
Show More
@@ -0,0 +1,44 b''
1 #!/bin/sh
2
3 echo "[extensions]" >> $HGRCPATH
4 echo "bookmarks=" >> $HGRCPATH
5 echo "mq=" >> $HGRCPATH
6
7 hg init
8
9 echo qqq>qqq.txt
10
11 echo % add file
12 hg add
13
14 echo % commit first revision
15 hg ci -m 1 -u user -d "1 0"
16
17 echo % set bookmark
18 hg book test
19
20 echo www>>qqq.txt
21
22 echo % commit second revision
23 hg ci -m 2 -u usr -d "1 0"
24
25 echo % set bookmark
26 hg book test2
27
28 echo % update to -2
29 hg update -r -2
30
31 echo eee>>qqq.txt
32
33 echo % commit new head
34 hg ci -m 3 -u user -d "1 0"
35
36 echo % bookmarks updated?
37 hg book
38
39 echo % strip to revision 1
40 hg strip 1 2>&1 | sed 's/\(saving bundle to \).*/\1/'
41
42 echo % list bookmarks
43 hg book
44
@@ -0,0 +1,24 b''
1 % add file
2 adding qqq.txt
3 % commit first revision
4 % set bookmark
5 % commit second revision
6 % set bookmark
7 % update to -2
8 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
9 % commit new head
10 created new head
11 % bookmarks updated?
12 test 1:16b24da7e457
13 test2 1:16b24da7e457
14 % strip to revision 1
15 saving bundle to
16 saving bundle to
17 adding branch
18 adding changesets
19 adding manifests
20 adding file changes
21 added 1 changesets with 1 changes to 1 files
22 % list bookmarks
23 * test 1:9f1b7e78eff8
24 * test2 1:9f1b7e78eff8
@@ -200,10 +200,7 b' def reposetup(ui, repo):'
200 return node
200 return node
201
201
202 def addchangegroup(self, source, srctype, url, emptyok=False):
202 def addchangegroup(self, source, srctype, url, emptyok=False):
203 try:
203 parents = repo.dirstate.parents()
204 onode = repo.changectx('.').node()
205 except RepoError, inst:
206 pass
207
204
208 result = super(bookmark_repo, self).addchangegroup(
205 result = super(bookmark_repo, self).addchangegroup(
209 source, srctype, url, emptyok)
206 source, srctype, url, emptyok)
@@ -214,7 +211,7 b' def reposetup(ui, repo):'
214 marks = parse(repo)
211 marks = parse(repo)
215 update = False
212 update = False
216 for mark, n in marks.items():
213 for mark, n in marks.items():
217 if n == onode:
214 if n in parents:
218 marks[mark] = node
215 marks[mark] = node
219 update = True
216 update = True
220 if update:
217 if update:
General Comments 0
You need to be logged in to leave comments. Login now