##// END OF EJS Templates
merge with stable
Matt Mackall -
r16128:004982e5 merge default
parent child Browse files
Show More
@@ -419,7 +419,7 b' def parsesplicemap(path):'
419 fp = open(path, 'r')
419 fp = open(path, 'r')
420 for i, line in enumerate(fp):
420 for i, line in enumerate(fp):
421 try:
421 try:
422 child, parents = line.splitlines()[0].rstrip().rsplit(' ', 1)
422 child, parents = line.splitlines()[0].rstrip().split(' ', 1)
423 parents = parents.replace(',', ' ').split()
423 parents = parents.replace(',', ' ').split()
424 except ValueError:
424 except ValueError:
425 raise util.Abort(_('syntax error in %s(%d): child parent1'
425 raise util.Abort(_('syntax error in %s(%d): child parent1'
@@ -118,8 +118,10 b' def reposetup(ui, repo):'
118 # handle it -- thus gaining a big performance boost.
118 # handle it -- thus gaining a big performance boost.
119 lfdirstate = lfutil.openlfdirstate(ui, self)
119 lfdirstate = lfutil.openlfdirstate(ui, self)
120 if match.files() and not match.anypats():
120 if match.files() and not match.anypats():
121 matchedfiles = [f for f in match.files() if f in lfdirstate]
121 for f in lfdirstate:
122 if not matchedfiles:
122 if match(f):
123 break
124 else:
123 return super(lfiles_repo, self).status(node1, node2,
125 return super(lfiles_repo, self).status(node1, node2,
124 match, listignored, listclean,
126 match, listignored, listclean,
125 listunknown, listsubrepos)
127 listunknown, listsubrepos)
@@ -1796,6 +1796,7 b' class queue(object):'
1796 if (len(files) > 1 or len(rev) > 1) and patchname:
1796 if (len(files) > 1 or len(rev) > 1) and patchname:
1797 raise util.Abort(_('option "-n" not valid when importing multiple '
1797 raise util.Abort(_('option "-n" not valid when importing multiple '
1798 'patches'))
1798 'patches'))
1799 imported = []
1799 if rev:
1800 if rev:
1800 # If mq patches are applied, we can only import revisions
1801 # If mq patches are applied, we can only import revisions
1801 # that form a linear path to qbase.
1802 # that form a linear path to qbase.
@@ -1848,6 +1849,7 b' class queue(object):'
1848 self.applied.insert(0, se)
1849 self.applied.insert(0, se)
1849
1850
1850 self.added.append(patchname)
1851 self.added.append(patchname)
1852 imported.append(patchname)
1851 patchname = None
1853 patchname = None
1852 if rev and repo.ui.configbool('mq', 'secret', False):
1854 if rev and repo.ui.configbool('mq', 'secret', False):
1853 # if we added anything with --rev, we must move the secret root
1855 # if we added anything with --rev, we must move the secret root
@@ -1902,9 +1904,11 b' class queue(object):'
1902 self.seriesdirty = True
1904 self.seriesdirty = True
1903 self.ui.warn(_("adding %s to series file\n") % patchname)
1905 self.ui.warn(_("adding %s to series file\n") % patchname)
1904 self.added.append(patchname)
1906 self.added.append(patchname)
1907 imported.append(patchname)
1905 patchname = None
1908 patchname = None
1906
1909
1907 self.removeundo(repo)
1910 self.removeundo(repo)
1911 return imported
1908
1912
1909 @command("qdelete|qremove|qrm",
1913 @command("qdelete|qremove|qrm",
1910 [('k', 'keep', None, _('keep patch file')),
1914 [('k', 'keep', None, _('keep patch file')),
@@ -2030,15 +2034,16 b' def qimport(ui, repo, *filename, **opts)'
2030 try:
2034 try:
2031 q = repo.mq
2035 q = repo.mq
2032 try:
2036 try:
2033 q.qimport(repo, filename, patchname=opts.get('name'),
2037 imported = q.qimport(
2034 existing=opts.get('existing'), force=opts.get('force'),
2038 repo, filename, patchname=opts.get('name'),
2035 rev=opts.get('rev'), git=opts.get('git'))
2039 existing=opts.get('existing'), force=opts.get('force'),
2040 rev=opts.get('rev'), git=opts.get('git'))
2036 finally:
2041 finally:
2037 q.savedirty()
2042 q.savedirty()
2038
2043
2039
2044
2040 if opts.get('push') and not opts.get('rev'):
2045 if imported and opts.get('push') and not opts.get('rev'):
2041 return q.push(repo, None)
2046 return q.push(repo, imported[-1])
2042 finally:
2047 finally:
2043 lock.release()
2048 lock.release()
2044 return 0
2049 return 0
@@ -186,6 +186,7 b' class server(object):'
186 self.repo.baseui = copiedui
186 self.repo.baseui = copiedui
187 self.repo.ui = self.repo.dirstate._ui = self.repoui.copy()
187 self.repo.ui = self.repo.dirstate._ui = self.repoui.copy()
188 self.repo.invalidate()
188 self.repo.invalidate()
189 self.repo.invalidatedirstate()
189
190
190 req = dispatch.request(args[:], copiedui, self.repo, self.cin,
191 req = dispatch.request(args[:], copiedui, self.repo, self.cin,
191 self.cout, self.cerr)
192 self.cout, self.cerr)
@@ -902,11 +902,11 b' class workingctx(changectx):'
902 try:
902 try:
903 rejected = []
903 rejected = []
904 for f in files:
904 for f in files:
905 if self._repo.dirstate[f] != 'a':
905 if f not in self._repo.dirstate:
906 self._repo.dirstate.remove(f)
907 elif f not in self._repo.dirstate:
908 self._repo.ui.warn(_("%s not tracked!\n") % join(f))
906 self._repo.ui.warn(_("%s not tracked!\n") % join(f))
909 rejected.append(f)
907 rejected.append(f)
908 elif self._repo.dirstate[f] != 'a':
909 self._repo.dirstate.remove(f)
910 else:
910 else:
911 self._repo.dirstate.drop(f)
911 self._repo.dirstate.drop(f)
912 return rejected
912 return rejected
@@ -949,6 +949,7 b' class localrepository(repo.repository):'
949 self.store.write()
949 self.store.write()
950 if self._dirtyphases:
950 if self._dirtyphases:
951 phases.writeroots(self)
951 phases.writeroots(self)
952 self._dirtyphases = False
952 for k, ce in self._filecache.items():
953 for k, ce in self._filecache.items():
953 if k == 'dirstate':
954 if k == 'dirstate':
954 continue
955 continue
@@ -1323,6 +1324,9 b' class localrepository(repo.repository):'
1323 # tag cache retrieval" case to work.
1324 # tag cache retrieval" case to work.
1324 self.invalidatecaches()
1325 self.invalidatecaches()
1325
1326
1327 # Discard all cache entries to force reloading everything.
1328 self._filecache.clear()
1329
1326 def walk(self, match, node=None):
1330 def walk(self, match, node=None):
1327 '''
1331 '''
1328 walk recursively through the directory tree or a given
1332 walk recursively through the directory tree or a given
@@ -475,9 +475,15 b' class workingbackend(fsbackend):'
475 addremoved = set(self.changed)
475 addremoved = set(self.changed)
476 for src, dst in self.copied:
476 for src, dst in self.copied:
477 scmutil.dirstatecopy(self.ui, self.repo, wctx, src, dst)
477 scmutil.dirstatecopy(self.ui, self.repo, wctx, src, dst)
478 addremoved.discard(src)
478 if self.removed:
479 if (not self.similarity) and self.removed:
480 wctx.forget(sorted(self.removed))
479 wctx.forget(sorted(self.removed))
480 for f in self.removed:
481 if f not in self.repo.dirstate:
482 # File was deleted and no longer belongs to the
483 # dirstate, it was probably marked added then
484 # deleted, and should not be considered by
485 # addremove().
486 addremoved.discard(f)
481 if addremoved:
487 if addremoved:
482 cwd = self.repo.getcwd()
488 cwd = self.repo.getcwd()
483 if cwd:
489 if cwd:
@@ -722,21 +728,19 b' class patchfile(object):'
722 h = h.getnormalized()
728 h = h.getnormalized()
723
729
724 # fast case first, no offsets, no fuzz
730 # fast case first, no offsets, no fuzz
725 old = h.old()
731 old, oldstart, new, newstart = h.fuzzit(0, False)
726 start = h.starta + self.offset
732 oldstart += self.offset
727 # zero length hunk ranges already have their start decremented
733 orig_start = oldstart
728 if h.lena:
729 start -= 1
730 orig_start = start
731 # if there's skew we want to emit the "(offset %d lines)" even
734 # if there's skew we want to emit the "(offset %d lines)" even
732 # when the hunk cleanly applies at start + skew, so skip the
735 # when the hunk cleanly applies at start + skew, so skip the
733 # fast case code
736 # fast case code
734 if self.skew == 0 and diffhelpers.testhunk(old, self.lines, start) == 0:
737 if (self.skew == 0 and
738 diffhelpers.testhunk(old, self.lines, oldstart) == 0):
735 if self.remove:
739 if self.remove:
736 self.backend.unlink(self.fname)
740 self.backend.unlink(self.fname)
737 else:
741 else:
738 self.lines[start : start + h.lena] = h.new()
742 self.lines[oldstart:oldstart + len(old)] = new
739 self.offset += h.lenb - h.lena
743 self.offset += len(new) - len(old)
740 self.dirty = True
744 self.dirty = True
741 return 0
745 return 0
742
746
@@ -744,23 +748,23 b' class patchfile(object):'
744 self.hash = {}
748 self.hash = {}
745 for x, s in enumerate(self.lines):
749 for x, s in enumerate(self.lines):
746 self.hash.setdefault(s, []).append(x)
750 self.hash.setdefault(s, []).append(x)
747 if h.hunk[-1][0] != ' ':
748 # if the hunk tried to put something at the bottom of the file
749 # override the start line and use eof here
750 search_start = len(self.lines)
751 else:
752 search_start = orig_start + self.skew
753
751
754 for fuzzlen in xrange(3):
752 for fuzzlen in xrange(3):
755 for toponly in [True, False]:
753 for toponly in [True, False]:
756 old = h.old(fuzzlen, toponly)
754 old, oldstart, new, newstart = h.fuzzit(fuzzlen, toponly)
755 oldstart = oldstart + self.offset + self.skew
756 oldstart = min(oldstart, len(self.lines))
757 if old:
758 cand = self.findlines(old[0][1:], oldstart)
759 else:
760 # Only adding lines with no or fuzzed context, just
761 # take the skew in account
762 cand = [oldstart]
757
763
758 cand = self.findlines(old[0][1:], search_start)
759 for l in cand:
764 for l in cand:
760 if diffhelpers.testhunk(old, self.lines, l) == 0:
765 if not old or diffhelpers.testhunk(old, self.lines, l) == 0:
761 newlines = h.new(fuzzlen, toponly)
766 self.lines[l : l + len(old)] = new
762 self.lines[l : l + len(old)] = newlines
767 self.offset += len(new) - len(old)
763 self.offset += len(newlines) - len(old)
764 self.skew = l - orig_start
768 self.skew = l - orig_start
765 self.dirty = True
769 self.dirty = True
766 offset = l - orig_start - fuzzlen
770 offset = l - orig_start - fuzzlen
@@ -965,11 +969,11 b' class hunk(object):'
965 def complete(self):
969 def complete(self):
966 return len(self.a) == self.lena and len(self.b) == self.lenb
970 return len(self.a) == self.lena and len(self.b) == self.lenb
967
971
968 def fuzzit(self, l, fuzz, toponly):
972 def _fuzzit(self, old, new, fuzz, toponly):
969 # this removes context lines from the top and bottom of list 'l'. It
973 # this removes context lines from the top and bottom of list 'l'. It
970 # checks the hunk to make sure only context lines are removed, and then
974 # checks the hunk to make sure only context lines are removed, and then
971 # returns a new shortened list of lines.
975 # returns a new shortened list of lines.
972 fuzz = min(fuzz, len(l)-1)
976 fuzz = min(fuzz, len(old))
973 if fuzz:
977 if fuzz:
974 top = 0
978 top = 0
975 bot = 0
979 bot = 0
@@ -987,26 +991,21 b' class hunk(object):'
987 else:
991 else:
988 break
992 break
989
993
990 # top and bot now count context in the hunk
994 bot = min(fuzz, bot)
991 # adjust them if either one is short
995 top = min(fuzz, top)
992 context = max(top, bot, 3)
996 return old[top:len(old)-bot], new[top:len(new)-bot], top
993 if bot < context:
997 return old, new, 0
994 bot = max(0, fuzz - (context - bot))
995 else:
996 bot = min(fuzz, bot)
997 if top < context:
998 top = max(0, fuzz - (context - top))
999 else:
1000 top = min(fuzz, top)
1001
998
1002 return l[top:len(l)-bot]
999 def fuzzit(self, fuzz, toponly):
1003 return l
1000 old, new, top = self._fuzzit(self.a, self.b, fuzz, toponly)
1004
1001 oldstart = self.starta + top
1005 def old(self, fuzz=0, toponly=False):
1002 newstart = self.startb + top
1006 return self.fuzzit(self.a, fuzz, toponly)
1003 # zero length hunk ranges already have their start decremented
1007
1004 if self.lena:
1008 def new(self, fuzz=0, toponly=False):
1005 oldstart -= 1
1009 return self.fuzzit(self.b, fuzz, toponly)
1006 if self.lenb:
1007 newstart -= 1
1008 return old, oldstart, new, newstart
1010
1009
1011 class binhunk(object):
1010 class binhunk(object):
1012 'A binary patch file. Only understands literals so far.'
1011 'A binary patch file. Only understands literals so far.'
@@ -803,6 +803,10 b' class filecache(object):'
803 return self
803 return self
804
804
805 def __get__(self, obj, type=None):
805 def __get__(self, obj, type=None):
806 # do we need to check if the file changed?
807 if self.name in obj.__dict__:
808 return obj.__dict__[self.name]
809
806 entry = obj._filecache.get(self.name)
810 entry = obj._filecache.get(self.name)
807
811
808 if entry:
812 if entry:
@@ -818,5 +822,16 b' class filecache(object):'
818
822
819 obj._filecache[self.name] = entry
823 obj._filecache[self.name] = entry
820
824
821 setattr(obj, self.name, entry.obj)
825 obj.__dict__[self.name] = entry.obj
822 return entry.obj
826 return entry.obj
827
828 def __set__(self, obj, value):
829 if self.name in obj._filecache:
830 obj._filecache[self.name].obj = value # update cached copy
831 obj.__dict__[self.name] = value # update copy returned by obj.x
832
833 def __delete__(self, obj):
834 try:
835 del obj.__dict__[self.name]
836 except KeyError:
837 raise AttributeError, self.name
@@ -112,6 +112,7 b' class statichttprepository(localrepo.loc'
112 self.spath = self.store.path
112 self.spath = self.store.path
113 self.sopener = self.store.opener
113 self.sopener = self.store.opener
114 self.sjoin = self.store.join
114 self.sjoin = self.store.join
115 self._filecache = {}
115
116
116 self.manifest = manifest.manifest(self.sopener)
117 self.manifest = manifest.manifest(self.sopener)
117 self.changelog = changelog.changelog(self.sopener)
118 self.changelog = changelog.changelog(self.sopener)
@@ -122,7 +123,6 b' class statichttprepository(localrepo.loc'
122 self.encodepats = None
123 self.encodepats = None
123 self.decodepats = None
124 self.decodepats = None
124 self.capabilities.difference_update(["pushkey"])
125 self.capabilities.difference_update(["pushkey"])
125 self._filecache = {}
126
126
127 def url(self):
127 def url(self):
128 return self._url
128 return self._url
@@ -27,6 +27,7 b' def readchannel(server):'
27
27
28 def runcommand(server, args, output=sys.stdout, error=sys.stderr, input=None):
28 def runcommand(server, args, output=sys.stdout, error=sys.stderr, input=None):
29 print ' runcommand', ' '.join(args)
29 print ' runcommand', ' '.join(args)
30 sys.stdout.flush()
30 server.stdin.write('runcommand\n')
31 server.stdin.write('runcommand\n')
31 writeblock(server, '\0'.join(args))
32 writeblock(server, '\0'.join(args))
32
33
@@ -56,6 +57,7 b' def check(func, repopath=None):'
56 print
57 print
57 print 'testing %s:' % func.__name__
58 print 'testing %s:' % func.__name__
58 print
59 print
60 sys.stdout.flush()
59 server = connect(repopath)
61 server = connect(repopath)
60 try:
62 try:
61 return func(server)
63 return func(server)
@@ -163,8 +165,10 b' def outsidechanges(server):'
163 f = open('a', 'ab')
165 f = open('a', 'ab')
164 f.write('a\n')
166 f.write('a\n')
165 f.close()
167 f.close()
168 runcommand(server, ['status'])
166 os.system('hg ci -Am2')
169 os.system('hg ci -Am2')
167 runcommand(server, ['tip'])
170 runcommand(server, ['tip'])
171 runcommand(server, ['status'])
168
172
169 def bookmarks(server):
173 def bookmarks(server):
170 readchannel(server)
174 readchannel(server)
@@ -179,6 +183,13 b' def bookmarks(server):'
179 os.system('hg upd bm1 -q')
183 os.system('hg upd bm1 -q')
180 runcommand(server, ['bookmarks'])
184 runcommand(server, ['bookmarks'])
181
185
186 runcommand(server, ['bookmarks', 'bm3'])
187 f = open('a', 'ab')
188 f.write('a\n')
189 f.close()
190 runcommand(server, ['commit', '-Amm'])
191 runcommand(server, ['bookmarks'])
192
182 def tagscache(server):
193 def tagscache(server):
183 readchannel(server)
194 readchannel(server)
184 runcommand(server, ['id', '-t', '-r', '0'])
195 runcommand(server, ['id', '-t', '-r', '0'])
@@ -191,6 +202,16 b' def setphase(server):'
191 os.system('hg phase -r . -p')
202 os.system('hg phase -r . -p')
192 runcommand(server, ['phase', '-r', '.'])
203 runcommand(server, ['phase', '-r', '.'])
193
204
205 def rollback(server):
206 readchannel(server)
207 runcommand(server, ['phase', '-r', '.', '-p'])
208 f = open('a', 'ab')
209 f.write('a\n')
210 f.close()
211 runcommand(server, ['commit', '-Am.'])
212 runcommand(server, ['rollback'])
213 runcommand(server, ['phase', '-r', '.'])
214
194 if __name__ == '__main__':
215 if __name__ == '__main__':
195 os.system('hg init')
216 os.system('hg init')
196
217
@@ -210,3 +231,4 b" if __name__ == '__main__':"
210 check(bookmarks)
231 check(bookmarks)
211 check(tagscache)
232 check(tagscache)
212 check(setphase)
233 check(setphase)
234 check(rollback)
@@ -4,10 +4,10 b' testing hellomessage:'
4 o, 'capabilities: getencoding runcommand\nencoding: ***'
4 o, 'capabilities: getencoding runcommand\nencoding: ***'
5 runcommand id
5 runcommand id
6 000000000000 tip
6 000000000000 tip
7 abort: unknown command unknowncommand
8
7
9 testing unknowncommand:
8 testing unknowncommand:
10
9
10 abort: unknown command unknowncommand
11
11
12 testing checkruncommand:
12 testing checkruncommand:
13
13
@@ -93,6 +93,8 b' eff892de26ec tip'
93
93
94 testing outsidechanges:
94 testing outsidechanges:
95
95
96 runcommand status
97 M a
96 runcommand tip
98 runcommand tip
97 changeset: 1:d3a0a68be6de
99 changeset: 1:d3a0a68be6de
98 tag: tip
100 tag: tip
@@ -100,6 +102,7 b' user: test'
100 date: Thu Jan 01 00:00:00 1970 +0000
102 date: Thu Jan 01 00:00:00 1970 +0000
101 summary: 2
103 summary: 2
102
104
105 runcommand status
103
106
104 testing bookmarks:
107 testing bookmarks:
105
108
@@ -111,6 +114,12 b' no bookmarks set'
111 runcommand bookmarks
114 runcommand bookmarks
112 * bm1 1:d3a0a68be6de
115 * bm1 1:d3a0a68be6de
113 bm2 1:d3a0a68be6de
116 bm2 1:d3a0a68be6de
117 runcommand bookmarks bm3
118 runcommand commit -Amm
119 runcommand bookmarks
120 bm1 1:d3a0a68be6de
121 bm2 1:d3a0a68be6de
122 * bm3 2:aef17e88f5f0
114
123
115 testing tagscache:
124 testing tagscache:
116
125
@@ -122,6 +131,17 b' foo'
122 testing setphase:
131 testing setphase:
123
132
124 runcommand phase -r .
133 runcommand phase -r .
125 2: draft
134 3: draft
126 runcommand phase -r .
135 runcommand phase -r .
127 2: public
136 3: public
137
138 testing rollback:
139
140 runcommand phase -r . -p
141 no phases changed
142 runcommand commit -Am.
143 runcommand rollback
144 repository tip rolled back to revision 3 (undo commit)
145 working directory now based on revision 3
146 runcommand phase -r .
147 3: public
@@ -123,11 +123,11 b' We want 2 to depend on 1 and 3. Since 3 '
123 the bug should be exhibited with all conversion orders.
123 the bug should be exhibited with all conversion orders.
124
124
125 $ cat > ../splicemap <<EOF
125 $ cat > ../splicemap <<EOF
126 > $(hg id -r 2 -i --debug) $(hg id -r 1 -i --debug),$(hg id -r 3 -i --debug)
126 > $(hg id -r 2 -i --debug) $(hg id -r 1 -i --debug), $(hg id -r 3 -i --debug)
127 > EOF
127 > EOF
128 $ cd ..
128 $ cd ..
129 $ cat splicemap
129 $ cat splicemap
130 7c364e7fa7d70ae525610c016317ed717b519d97 717d54d67e6c31fd75ffef2ff3042bdd98418437,102a90ea7b4a3361e4082ed620918c261189a36a
130 7c364e7fa7d70ae525610c016317ed717b519d97 717d54d67e6c31fd75ffef2ff3042bdd98418437, 102a90ea7b4a3361e4082ed620918c261189a36a
131
131
132 Test regular conversion
132 Test regular conversion
133
133
@@ -111,7 +111,15 b' Test unsupported combinations'
111
111
112 Test commit editor
112 Test commit editor
113
113
114 $ hg diff -c 1 > ../test.diff
114 $ cat > ../test.diff <<EOF
115 > diff -r 07f494440405 -r 4e322f7ce8e3 a
116 > --- a/a Thu Jan 01 00:00:00 1970 +0000
117 > +++ b/a Thu Jan 01 00:00:00 1970 +0000
118 > @@ -1,1 +1,2 @@
119 > -a
120 > +b
121 > +c
122 > EOF
115 $ HGEDITOR=cat hg import --bypass ../test.diff
123 $ HGEDITOR=cat hg import --bypass ../test.diff
116 applying ../test.diff
124 applying ../test.diff
117
125
@@ -138,7 +146,7 b' Test patch.eol is handled'
138 $ hg --config patch.eol=auto import -d '0 0' -m 'test patch.eol' --bypass ../test.diff
146 $ hg --config patch.eol=auto import -d '0 0' -m 'test patch.eol' --bypass ../test.diff
139 applying ../test.diff
147 applying ../test.diff
140 $ shortlog
148 $ shortlog
141 o 3:d7805b4d2cb3 test 0 0 - default - test patch.eol
149 o 3:c606edafba99 test 0 0 - default - test patch.eol
142 |
150 |
143 @ 2:872023de769d test 0 0 - default - makeacrlf
151 @ 2:872023de769d test 0 0 - default - makeacrlf
144 |
152 |
@@ -402,6 +402,23 b' Renames and strip'
402 A b
402 A b
403 a
403 a
404 R a
404 R a
405
406 Renames, similarity and git diff
407
408 $ hg revert -aC
409 undeleting a
410 forgetting b
411 $ rm b
412 $ hg import --similarity 90 --no-commit - <<EOF
413 > diff --git a/a b/b
414 > rename from a
415 > rename to b
416 > EOF
417 applying patch from stdin
418 $ hg st --copies
419 A b
420 a
421 R a
405 $ cd ..
422 $ cd ..
406
423
407 Pure copy with existing destination
424 Pure copy with existing destination
@@ -445,7 +445,7 b' Test fuzziness (ambiguous patch location'
445 $ hg import --no-commit -v fuzzy-tip.patch
445 $ hg import --no-commit -v fuzzy-tip.patch
446 applying fuzzy-tip.patch
446 applying fuzzy-tip.patch
447 patching file a
447 patching file a
448 Hunk #1 succeeded at 1 with fuzz 2 (offset -2 lines).
448 Hunk #1 succeeded at 2 with fuzz 1 (offset 0 lines).
449 applied to working directory
449 applied to working directory
450 $ hg revert -a
450 $ hg revert -a
451 reverting a
451 reverting a
@@ -462,7 +462,7 b' test fuzziness with eol=auto'
462 $ hg --config patch.eol=auto import --no-commit -v fuzzy-tip.patch
462 $ hg --config patch.eol=auto import --no-commit -v fuzzy-tip.patch
463 applying fuzzy-tip.patch
463 applying fuzzy-tip.patch
464 patching file a
464 patching file a
465 Hunk #1 succeeded at 1 with fuzz 2 (offset -2 lines).
465 Hunk #1 succeeded at 2 with fuzz 1 (offset 0 lines).
466 applied to working directory
466 applied to working directory
467 $ cd ..
467 $ cd ..
468
468
@@ -663,7 +663,6 b' test import with similarity and git and '
663 applying ../rename.diff
663 applying ../rename.diff
664 patching file a
664 patching file a
665 patching file b
665 patching file b
666 removing a
667 adding b
666 adding b
668 recording removal of a as rename to b (88% similar)
667 recording removal of a as rename to b (88% similar)
669 applied to working directory
668 applied to working directory
@@ -679,7 +678,6 b' test import with similarity and git and '
679 applying ../rename.diff
678 applying ../rename.diff
680 patching file a
679 patching file a
681 patching file b
680 patching file b
682 removing a
683 adding b
681 adding b
684 applied to working directory
682 applied to working directory
685 $ hg st -C
683 $ hg st -C
@@ -998,3 +996,102 b' import a unified diff with no lines of c'
998 c2
996 c2
999 c3
997 c3
1000 c4
998 c4
999
1000 Test corner case involving fuzz and skew
1001
1002 $ hg init morecornercases
1003 $ cd morecornercases
1004
1005 $ cat > 01-no-context-beginning-of-file.diff <<EOF
1006 > diff --git a/a b/a
1007 > --- a/a
1008 > +++ b/a
1009 > @@ -1,0 +1,1 @@
1010 > +line
1011 > EOF
1012
1013 $ cat > 02-no-context-middle-of-file.diff <<EOF
1014 > diff --git a/a b/a
1015 > --- a/a
1016 > +++ b/a
1017 > @@ -1,1 +1,1 @@
1018 > -2
1019 > +add some skew
1020 > @@ -2,0 +2,1 @@
1021 > +line
1022 > EOF
1023
1024 $ cat > 03-no-context-end-of-file.diff <<EOF
1025 > diff --git a/a b/a
1026 > --- a/a
1027 > +++ b/a
1028 > @@ -10,0 +10,1 @@
1029 > +line
1030 > EOF
1031
1032 $ cat > 04-middle-of-file-completely-fuzzed.diff <<EOF
1033 > diff --git a/a b/a
1034 > --- a/a
1035 > +++ b/a
1036 > @@ -1,1 +1,1 @@
1037 > -2
1038 > +add some skew
1039 > @@ -2,2 +2,3 @@
1040 > not matching, should fuzz
1041 > ... a bit
1042 > +line
1043 > EOF
1044
1045 $ cat > a <<EOF
1046 > 1
1047 > 2
1048 > 3
1049 > 4
1050 > EOF
1051 $ hg ci -Am adda a
1052 $ for p in *.diff; do
1053 > hg import -v --no-commit $p
1054 > cat a
1055 > hg revert -aqC a
1056 > # patch -p1 < $p
1057 > # cat a
1058 > # hg revert -aC a
1059 > done
1060 applying 01-no-context-beginning-of-file.diff
1061 patching file a
1062 applied to working directory
1063 1
1064 line
1065 2
1066 3
1067 4
1068 applying 02-no-context-middle-of-file.diff
1069 patching file a
1070 Hunk #1 succeeded at 2 (offset 1 lines).
1071 Hunk #2 succeeded at 4 (offset 1 lines).
1072 applied to working directory
1073 1
1074 add some skew
1075 3
1076 line
1077 4
1078 applying 03-no-context-end-of-file.diff
1079 patching file a
1080 Hunk #1 succeeded at 5 (offset -6 lines).
1081 applied to working directory
1082 1
1083 2
1084 3
1085 4
1086 line
1087 applying 04-middle-of-file-completely-fuzzed.diff
1088 patching file a
1089 Hunk #1 succeeded at 2 (offset 1 lines).
1090 Hunk #2 succeeded at 5 with fuzz 2 (offset 1 lines).
1091 applied to working directory
1092 1
1093 add some skew
1094 3
1095 4
1096 line
1097
@@ -948,4 +948,50 b' Symlink to a large largefile should beha'
948 $ test -L largelink
948 $ test -L largelink
949 $ cd ..
949 $ cd ..
950
950
951 test for pattern matching on 'hg status':
952 to boost performance, largefiles checks whether specified patterns are
953 related to largefiles in working directory (NOT to STANDIN) or not.
951
954
955 $ hg init statusmatch
956 $ cd statusmatch
957
958 $ mkdir -p a/b/c/d
959 $ echo normal > a/b/c/d/e.normal.txt
960 $ hg add a/b/c/d/e.normal.txt
961 $ echo large > a/b/c/d/e.large.txt
962 $ hg add --large a/b/c/d/e.large.txt
963 $ mkdir -p a/b/c/x
964 $ echo normal > a/b/c/x/y.normal.txt
965 $ hg add a/b/c/x/y.normal.txt
966 $ hg commit -m 'add files'
967 Invoking status precommit hook
968 A a/b/c/d/e.large.txt
969 A a/b/c/d/e.normal.txt
970 A a/b/c/x/y.normal.txt
971
972 (1) no pattern: no performance boost
973 $ hg status -A
974 C a/b/c/d/e.large.txt
975 C a/b/c/d/e.normal.txt
976 C a/b/c/x/y.normal.txt
977
978 (2) pattern not related to largefiles: performance boost
979 $ hg status -A a/b/c/x
980 C a/b/c/x/y.normal.txt
981
982 (3) pattern related to largefiles: no performance boost
983 $ hg status -A a/b/c/d
984 C a/b/c/d/e.large.txt
985 C a/b/c/d/e.normal.txt
986
987 (4) pattern related to STANDIN (not to largefiles): performance boost
988 $ hg status -A .hglf/a
989 C .hglf/a/b/c/d/e.large.txt
990
991 (5) mixed case: no performance boost
992 $ hg status -A a/b/c/x a/b/c/d
993 C a/b/c/d/e.large.txt
994 C a/b/c/d/e.normal.txt
995 C a/b/c/x/y.normal.txt
996
997 $ cd ..
@@ -125,12 +125,10 b' Merge:'
125 merging with queue at: $TESTTMP/t2/.hg/refqueue (glob)
125 merging with queue at: $TESTTMP/t2/.hg/refqueue (glob)
126 applying patcha
126 applying patcha
127 patching file a
127 patching file a
128 Hunk #1 FAILED at 0
128 Hunk #1 succeeded at 2 with fuzz 1 (offset 0 lines).
129 1 out of 1 hunks FAILED -- saving rejects to file a.rej
129 fuzz found when applying patch, stopping
130 patch failed, unable to continue (try -v)
131 patch failed, rejects left in working dir
132 patch didn't work out, merging patcha
130 patch didn't work out, merging patcha
133 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
131 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
134 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
132 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
135 (branch merge, don't forget to commit)
133 (branch merge, don't forget to commit)
136 applying patcha2
134 applying patcha2
@@ -153,21 +153,41 b' qimport CRLF diff'
153
153
154 try to import --push
154 try to import --push
155
155
156 $ echo another >> b
156 $ cat > appendfoo.diff <<EOF
157 $ hg diff > another.diff
157 > append foo
158 $ hg up -C
158 >
159 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
159 > diff -r 07f494440405 -r 261500830e46 baz
160 $ hg qimport --push another.diff
160 > --- /dev/null Thu Jan 01 00:00:00 1970 +0000
161 adding another.diff to series file
161 > +++ b/baz Thu Jan 01 00:00:00 1970 +0000
162 applying another.diff
162 > @@ -0,0 +1,1 @@
163 now at: another.diff
163 > +foo
164 > EOF
165
166 $ cat > appendbar.diff <<EOF
167 > append bar
168 >
169 > diff -r 07f494440405 -r 261500830e46 baz
170 > --- a/baz Thu Jan 01 00:00:00 1970 +0000
171 > +++ b/baz Thu Jan 01 00:00:00 1970 +0000
172 > @@ -1,1 +1,2 @@
173 > foo
174 > +bar
175 > EOF
176
177 $ hg qimport --push appendfoo.diff appendbar.diff
178 adding appendfoo.diff to series file
179 adding appendbar.diff to series file
180 applying appendfoo.diff
181 applying appendbar.diff
182 now at: appendbar.diff
164 $ hg qfin -a
183 $ hg qfin -a
165 patch b.diff finalized without changeset message
184 patch b.diff finalized without changeset message
166 patch another.diff finalized without changeset message
185 $ hg qimport -r 'p1(.)::' -P
167 $ hg qimport -rtip -P
168 $ hg qpop -a
186 $ hg qpop -a
187 popping 3.diff
169 popping 2.diff
188 popping 2.diff
170 patch queue now empty
189 patch queue now empty
190 $ hg qdel 3.diff
171 $ hg qdel -k 2.diff
191 $ hg qdel -k 2.diff
172
192
173 qimport -e
193 qimport -e
General Comments 0
You need to be logged in to leave comments. Login now