##// END OF EJS Templates
Don't report an error when closing heads during local push (issue387)
Thomas Arendsen Hein -
r3803:2aef481a default
parent child Browse files
Show More
@@ -1742,8 +1742,13 b' class localrepository(repo.repository):'
1742
1742
1743 def addchangegroup(self, source, srctype, url):
1743 def addchangegroup(self, source, srctype, url):
1744 """add changegroup to repo.
1744 """add changegroup to repo.
1745 returns number of heads modified or added + 1."""
1746
1745
1746 return values:
1747 - nothing changed or no source: 0
1748 - more heads than before: 1+added heads (2..n)
1749 - less heads than before: -1-removed heads (-2..-n)
1750 - number of heads stays the same: 1
1751 """
1747 def csmap(x):
1752 def csmap(x):
1748 self.ui.debug(_("add changeset %s\n") % short(x))
1753 self.ui.debug(_("add changeset %s\n") % short(x))
1749 return cl.count()
1754 return cl.count()
@@ -1836,7 +1841,11 b' class localrepository(repo.repository):'
1836 self.hook("incoming", node=hex(self.changelog.node(i)),
1841 self.hook("incoming", node=hex(self.changelog.node(i)),
1837 source=srctype, url=url)
1842 source=srctype, url=url)
1838
1843
1839 return newheads - oldheads + 1
1844 # never return 0 here:
1845 if newheads < oldheads:
1846 return newheads - oldheads - 1
1847 else:
1848 return newheads - oldheads + 1
1840
1849
1841
1850
1842 def stream_in(self, remote):
1851 def stream_in(self, remote):
@@ -47,10 +47,11 b' done'
47 HGMERGE=true hg merge 3
47 HGMERGE=true hg merge 3
48 hg ci -m c-d -d "1000000 0"
48 hg ci -m c-d -d "1000000 0"
49
49
50 hg push ../c
50 hg push ../c; echo $?
51 hg push -r 2 ../c
51 hg push -r 2 ../c; echo $?
52 hg push -r 3 -r 4 ../c
52 hg push -r 3 ../c; echo $?
53 hg push -f -r 3 -r 4 ../c
53 hg push -r 3 -r 4 ../c; echo $?
54 hg push -r 5 ../c
54 hg push -f -r 3 -r 4 ../c; echo $?
55 hg push -r 5 ../c; echo $?
55
56
56 exit 0
57 exit 0
@@ -33,22 +33,32 b' pushing to ../c'
33 searching for changes
33 searching for changes
34 abort: push creates new remote branches!
34 abort: push creates new remote branches!
35 (did you forget to merge? use push -f to force)
35 (did you forget to merge? use push -f to force)
36 0
36 pushing to ../c
37 pushing to ../c
37 searching for changes
38 searching for changes
38 no changes found
39 no changes found
40 0
39 pushing to ../c
41 pushing to ../c
40 searching for changes
42 searching for changes
41 abort: push creates new remote branches!
43 abort: push creates new remote branches!
42 (did you forget to merge? use push -f to force)
44 (did you forget to merge? use push -f to force)
45 0
46 pushing to ../c
47 searching for changes
48 abort: push creates new remote branches!
49 (did you forget to merge? use push -f to force)
50 0
43 pushing to ../c
51 pushing to ../c
44 searching for changes
52 searching for changes
45 adding changesets
53 adding changesets
46 adding manifests
54 adding manifests
47 adding file changes
55 adding file changes
48 added 2 changesets with 2 changes to 1 files (+2 heads)
56 added 2 changesets with 2 changes to 1 files (+2 heads)
57 0
49 pushing to ../c
58 pushing to ../c
50 searching for changes
59 searching for changes
51 adding changesets
60 adding changesets
52 adding manifests
61 adding manifests
53 adding file changes
62 adding file changes
54 added 1 changesets with 1 changes to 1 files (-1 heads)
63 added 1 changesets with 1 changes to 1 files (-1 heads)
64 0
General Comments 0
You need to be logged in to leave comments. Login now