##// END OF EJS Templates
subrepo: print paths relative to upper repo root for push/pull/commit...
Edouard Gomez -
r11112:4a9bee61 default
parent child Browse files
Show More
@@ -867,8 +867,10 b' class localrepository(repo.repository):'
867 867 if subs or removedsubs:
868 868 state = wctx.substate.copy()
869 869 for s in subs:
870 self.ui.status(_('committing subrepository %s\n') % s)
871 sr = wctx.sub(s).commit(cctx._text, user, date)
870 sub = wctx.sub(s)
871 self.ui.status(_('committing subrepository %s\n') %
872 subrepo.relpath(sub))
873 sr = sub.commit(cctx._text, user, date)
872 874 state[s] = (state[s][0], sr)
873 875 subrepo.writestate(self, state)
874 876
@@ -126,6 +126,14 b' def submerge(repo, wctx, mctx, actx):'
126 126 # record merged .hgsubstate
127 127 writestate(repo, sm)
128 128
129 def relpath(sub):
130 if not hasattr(sub, '_repo'):
131 return sub._path
132 parent = sub._repo
133 while hasattr(parent, '_subparent'):
134 parent = parent._subparent
135 return sub._repo.root[len(parent.root)+1:]
136
129 137 def _abssource(repo, push=False):
130 138 if hasattr(repo, '_subparent'):
131 139 source = repo._subsource
@@ -214,7 +222,7 b' class hgsubrepo(object):'
214 222 return w.dirty() # working directory changed
215 223
216 224 def commit(self, text, user, date):
217 self._repo.ui.debug("committing subrepo %s\n" % self._path)
225 self._repo.ui.debug("committing subrepo %s\n" % relpath(self))
218 226 n = self._repo.commit(text, user, date)
219 227 if not n:
220 228 return self._repo['.'].hex() # different version checked out
@@ -223,7 +231,7 b' class hgsubrepo(object):'
223 231 def remove(self):
224 232 # we can't fully delete the repository as it may contain
225 233 # local-only history
226 self._repo.ui.note(_('removing subrepo %s\n') % self._path)
234 self._repo.ui.note(_('removing subrepo %s\n') % relpath(self))
227 235 hg.clean(self._repo, node.nullid, False)
228 236
229 237 def _get(self, state):
@@ -234,7 +242,7 b' class hgsubrepo(object):'
234 242 self._repo._subsource = source
235 243 srcurl = _abssource(self._repo)
236 244 self._repo.ui.status(_('pulling subrepo %s from %s\n')
237 % (self._path, srcurl))
245 % (relpath(self), srcurl))
238 246 other = hg.repository(self._repo.ui, srcurl)
239 247 self._repo.pull(other)
240 248
@@ -250,12 +258,12 b' class hgsubrepo(object):'
250 258 dst = self._repo[state[1]]
251 259 anc = dst.ancestor(cur)
252 260 if anc == cur:
253 self._repo.ui.debug("updating subrepo %s\n" % self._path)
261 self._repo.ui.debug("updating subrepo %s\n" % relpath(self))
254 262 hg.update(self._repo, state[1])
255 263 elif anc == dst:
256 self._repo.ui.debug("skipping subrepo %s\n" % self._path)
264 self._repo.ui.debug("skipping subrepo %s\n" % relpath(self))
257 265 else:
258 self._repo.ui.debug("merging subrepo %s\n" % self._path)
266 self._repo.ui.debug("merging subrepo %s\n" % relpath(self))
259 267 hg.merge(self._repo, state[1], remind=False)
260 268
261 269 def push(self, force):
@@ -268,7 +276,7 b' class hgsubrepo(object):'
268 276
269 277 dsturl = _abssource(self._repo, True)
270 278 self._repo.ui.status(_('pushing subrepo %s to %s\n') %
271 (self._path, dsturl))
279 (relpath(self), dsturl))
272 280 other = hg.repository(self._repo.ui, dsturl)
273 281 return self._repo.push(other, force)
274 282
@@ -50,7 +50,7 b' path sub2'
50 50 revision c57a0840e3badd667ef3c3ef65471609acb2ba3c
51 51 % Modifying deeply nested sub2
52 52 committing subrepository sub1
53 committing subrepository sub2
53 committing subrepository sub1/sub2
54 54 % Checking modified node ids
55 55 cloned ffe6649062fe tip
56 56 cloned/sub1 2ecb03bf44a9 tip
@@ -129,7 +129,7 b' adding changesets'
129 129 adding manifests
130 130 adding file changes
131 131 added 4 changesets with 5 changes to 3 files
132 pulling subrepo ss from .../sub/t/s/ss
132 pulling subrepo s/ss from .../sub/t/s/ss
133 133 requesting all changes
134 134 adding changesets
135 135 adding manifests
General Comments 0
You need to be logged in to leave comments. Login now