##// END OF EJS Templates
bookmarks: move diff to core
Matt Mackall -
r13354:4e1ba6ea default
parent child Browse files
Show More
@@ -342,27 +342,12 b' def push(oldpush, ui, repo, dest=None, *'
342
342
343 return result
343 return result
344
344
345 def diffbookmarks(ui, repo, remote):
346 ui.status(_("searching for changed bookmarks\n"))
347
348 lmarks = repo.listkeys('bookmarks')
349 rmarks = remote.listkeys('bookmarks')
350
351 diff = sorted(set(rmarks) - set(lmarks))
352 for k in diff:
353 ui.write(" %-25s %s\n" % (k, rmarks[k][:12]))
354
355 if len(diff) <= 0:
356 ui.status(_("no changed bookmarks found\n"))
357 return 1
358 return 0
359
360 def incoming(oldincoming, ui, repo, source="default", **opts):
345 def incoming(oldincoming, ui, repo, source="default", **opts):
361 if opts.get('bookmarks'):
346 if opts.get('bookmarks'):
362 source, branches = hg.parseurl(ui.expandpath(source), opts.get('branch'))
347 source, branches = hg.parseurl(ui.expandpath(source), opts.get('branch'))
363 other = hg.repository(hg.remoteui(repo, opts), source)
348 other = hg.repository(hg.remoteui(repo, opts), source)
364 ui.status(_('comparing with %s\n') % url.hidepassword(source))
349 ui.status(_('comparing with %s\n') % url.hidepassword(source))
365 return diffbookmarks(ui, repo, other)
350 return bookmarks.diff(ui, repo, other)
366 else:
351 else:
367 return oldincoming(ui, repo, source, **opts)
352 return oldincoming(ui, repo, source, **opts)
368
353
@@ -372,7 +357,7 b' def outgoing(oldoutgoing, ui, repo, dest'
372 dest, branches = hg.parseurl(dest, opts.get('branch'))
357 dest, branches = hg.parseurl(dest, opts.get('branch'))
373 other = hg.repository(hg.remoteui(repo, opts), dest)
358 other = hg.repository(hg.remoteui(repo, opts), dest)
374 ui.status(_('comparing with %s\n') % url.hidepassword(dest))
359 ui.status(_('comparing with %s\n') % url.hidepassword(dest))
375 return diffbookmarks(ui, other, repo)
360 return bookmarks.diff(ui, other, repo)
376 else:
361 else:
377 return oldoutgoing(ui, repo, dest, **opts)
362 return oldoutgoing(ui, repo, dest, **opts)
378
363
@@ -149,3 +149,18 b' def pushbookmark(repo, key, old, new):'
149 return True
149 return True
150 finally:
150 finally:
151 w.release()
151 w.release()
152
153 def diff(ui, repo, remote):
154 ui.status(_("searching for changed bookmarks\n"))
155
156 lmarks = repo.listkeys('bookmarks')
157 rmarks = remote.listkeys('bookmarks')
158
159 diff = sorted(set(rmarks) - set(lmarks))
160 for k in diff:
161 ui.write(" %-25s %s\n" % (k, rmarks[k][:12]))
162
163 if len(diff) <= 0:
164 ui.status(_("no changed bookmarks found\n"))
165 return 1
166 return 0
General Comments 0
You need to be logged in to leave comments. Login now