##// END OF EJS Templates
Issue a warning if "-r ." is used with two working directory parents....
Thomas Arendsen Hein -
r4510:e0bc2c57 default
parent child Browse files
Show More
@@ -437,9 +437,12 b' class localrepository(repo.repository):'
437
437
438 def lookup(self, key):
438 def lookup(self, key):
439 if key == '.':
439 if key == '.':
440 key = self.dirstate.parents()[0]
440 key, second = self.dirstate.parents()
441 if key == nullid:
441 if key == nullid:
442 raise repo.RepoError(_("no revision checked out"))
442 raise repo.RepoError(_("no revision checked out"))
443 if second != nullid:
444 self.ui.warn(_("warning: working directory has two parents, "
445 "tag '.' uses the first\n"))
443 elif key == 'null':
446 elif key == 'null':
444 return nullid
447 return nullid
445 n = self.changelog._match(key)
448 n = self.changelog._match(key)
@@ -47,6 +47,7 b' hg log -pv d'
47 # log --follow tests
47 # log --follow tests
48 hg init ../follow
48 hg init ../follow
49 cd ../follow
49 cd ../follow
50
50 echo base > base
51 echo base > base
51 hg ci -Ambase -d '1 0'
52 hg ci -Ambase -d '1 0'
52
53
@@ -71,8 +72,15 b' hg log -f -r 1:tip'
71
72
72 hg up -C 3
73 hg up -C 3
73 hg merge tip
74 hg merge tip
75
76 echo % log -r . with two parents
77 hg log -r .
78
74 hg ci -mm12 -d '1 0'
79 hg ci -mm12 -d '1 0'
75
80
81 echo % log -r . with one parent
82 hg log -r .
83
76 echo postm >> b1
84 echo postm >> b1
77 hg ci -Amb1.1 -d'1 0'
85 hg ci -Amb1.1 -d'1 0'
78
86
@@ -144,6 +144,23 b' summary: b1'
144 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
144 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
145 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
145 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
146 (branch merge, don't forget to commit)
146 (branch merge, don't forget to commit)
147 % log -r . with two parents
148 warning: working directory has two parents, tag '.' uses the first
149 changeset: 3:e62f78d544b4
150 parent: 1:3d5bf5654eda
151 user: test
152 date: Thu Jan 01 00:00:01 1970 +0000
153 summary: b1
154
155 % log -r . with one parent
156 changeset: 5:302e9dd6890d
157 tag: tip
158 parent: 3:e62f78d544b4
159 parent: 4:ddb82e70d1a1
160 user: test
161 date: Thu Jan 01 00:00:01 1970 +0000
162 summary: m12
163
147 % log --follow-first
164 % log --follow-first
148 changeset: 6:2404bbcab562
165 changeset: 6:2404bbcab562
149 tag: tip
166 tag: tip
General Comments 0
You need to be logged in to leave comments. Login now