##// END OF EJS Templates
merge with stable
Martin von Zweigbergk -
r38445:00368bc0 merge default
parent child Browse files
Show More
@@ -135,12 +135,22 b' static int find_lines(lazymanifest *self'
135 return 0;
135 return 0;
136 }
136 }
137
137
138 static void lazymanifest_init_early(lazymanifest *self)
139 {
140 self->pydata = NULL;
141 self->lines = NULL;
142 self->numlines = 0;
143 self->maxlines = 0;
144 }
145
138 static int lazymanifest_init(lazymanifest *self, PyObject *args)
146 static int lazymanifest_init(lazymanifest *self, PyObject *args)
139 {
147 {
140 char *data;
148 char *data;
141 Py_ssize_t len;
149 Py_ssize_t len;
142 int err, ret;
150 int err, ret;
143 PyObject *pydata;
151 PyObject *pydata;
152
153 lazymanifest_init_early(self);
144 if (!PyArg_ParseTuple(args, "S", &pydata)) {
154 if (!PyArg_ParseTuple(args, "S", &pydata)) {
145 return -1;
155 return -1;
146 }
156 }
@@ -668,6 +678,7 b' static lazymanifest *lazymanifest_copy(l'
668 if (!copy) {
678 if (!copy) {
669 goto nomem;
679 goto nomem;
670 }
680 }
681 lazymanifest_init_early(copy);
671 copy->numlines = self->numlines;
682 copy->numlines = self->numlines;
672 copy->livelines = self->livelines;
683 copy->livelines = self->livelines;
673 copy->dirty = false;
684 copy->dirty = false;
@@ -705,6 +716,7 b' static lazymanifest *lazymanifest_filter'
705 if (!copy) {
716 if (!copy) {
706 goto nomem;
717 goto nomem;
707 }
718 }
719 lazymanifest_init_early(copy);
708 copy->dirty = true;
720 copy->dirty = true;
709 copy->lines = malloc(self->maxlines * sizeof(line));
721 copy->lines = malloc(self->maxlines * sizeof(line));
710 if (!copy->lines) {
722 if (!copy->lines) {
@@ -403,7 +403,7 b' class uihunk(patchnode):'
403 if fromline != 0:
403 if fromline != 0:
404 if fromlen == 0:
404 if fromlen == 0:
405 fromline -= 1
405 fromline -= 1
406 if tolen == 0:
406 if tolen == 0 and toline > 0:
407 toline -= 1
407 toline -= 1
408
408
409 fromtoline = '@@ -%d,%d +%d,%d @@%s\n' % (
409 fromtoline = '@@ -%d,%d +%d,%d @@%s\n' % (
@@ -1150,8 +1150,10 b' def manifestmerge(repo, wctx, p2, pa, br'
1150 copied = set(copy.values())
1150 copied = set(copy.values())
1151 copied.update(movewithdir.values())
1151 copied.update(movewithdir.values())
1152
1152
1153 if '.hgsubstate' in m1:
1153 if '.hgsubstate' in m1 and wctx.rev() is None:
1154 # check whether sub state is modified
1154 # Check whether sub state is modified, and overwrite the manifest
1155 # to flag the change. If wctx is a committed revision, we shouldn't
1156 # care for the dirty state of the working directory.
1155 if any(wctx.sub(s).dirty() for s in wctx.substate):
1157 if any(wctx.sub(s).dirty() for s in wctx.substate):
1156 m1['.hgsubstate'] = modifiednodeid
1158 m1['.hgsubstate'] = modifiednodeid
1157
1159
@@ -214,6 +214,14 b' Amend option works'
214 @@ -0,0 +1,1 @@
214 @@ -0,0 +1,1 @@
215 +hello world
215 +hello world
216
216
217 Make file empty
218 $ printf "" > x
219 $ cat <<EOF >testModeCommands
220 > X
221 > EOF
222 $ hg ci -i -m emptify -d "0 0"
223 $ hg update -C '.^' -q
224
217 Editing a hunk puts you back on that hunk when done editing (issue5041)
225 Editing a hunk puts you back on that hunk when done editing (issue5041)
218 To do that, we change two lines in a file, pretend to edit the second line,
226 To do that, we change two lines in a file, pretend to edit the second line,
219 exit, toggle the line selected at the end of the edit and commit.
227 exit, toggle the line selected at the end of the edit and commit.
@@ -236,7 +244,7 b' of the edit.'
236 > X
244 > X
237 > EOF
245 > EOF
238 $ printf "printf 'editor ran\n'; exit 0" > editor.sh
246 $ printf "printf 'editor ran\n'; exit 0" > editor.sh
239 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit -i -m "edit hunk" -d "0 0"
247 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit -i -m "edit hunk" -d "0 0" -q
240 editor ran
248 editor ran
241 $ hg cat -r . x
249 $ hg cat -r . x
242 foo
250 foo
@@ -1941,3 +1941,43 b' and bad usernames:'
1941 updating to branch default
1941 updating to branch default
1942 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch owned@example.com/path' (in subrepository "s")
1942 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch owned@example.com/path' (in subrepository "s")
1943 [255]
1943 [255]
1944
1945 Test convert subrepositories including merge (issue5526):
1946
1947 $ hg init tconv
1948 $ hg convert --config extensions.convert= -q t/s tconv/s
1949 $ hg convert --config extensions.convert= -q t/s/ss tconv/s/ss
1950 $ hg convert --config extensions.convert= -q t/t tconv/t
1951
1952 convert shouldn't fail because of pseudo filenode:
1953
1954 $ hg convert --config extensions.convert= t tconv
1955 scanning source...
1956 sorting...
1957 converting...
1958 17 0
1959 16 1
1960 15 2
1961 14 3
1962 13 4
1963 12 5
1964 11 6
1965 10 7
1966 9 8
1967 8 9
1968 7 10
1969 6 11
1970 5 12
1971 4 13
1972 3 rm2
1973 2 phasecheck4
1974 1 16
1975 0 branch before subrepo add
1976
1977 converted .hgsubstate should point to valid nodes:
1978
1979 $ hg up -R tconv 9
1980 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1981 $ cat tconv/.hgsubstate
1982 fc627a69481fcbe5f1135069e8a3881c023e4cf5 s
1983 60ca1237c19474e7a3978b0dc1ca4e6f36d51382 t
General Comments 0
You need to be logged in to leave comments. Login now