##// END OF EJS Templates
id: add bookmarks to id...
Kevin Bullock -
r13477:0fb2ff94 stable
parent child Browse files
Show More
@@ -2240,8 +2240,8 b' def help_(ui, name=None, with_version=Fa'
2240 else:
2240 else:
2241 ui.write("%s\n" % opt)
2241 ui.write("%s\n" % opt)
2242
2242
2243 def identify(ui, repo, source=None,
2243 def identify(ui, repo, source=None, rev=None,
2244 rev=None, num=None, id=None, branch=None, tags=None):
2244 num=None, id=None, branch=None, tags=None, bookmarks=None):
2245 """identify the working copy or specified revision
2245 """identify the working copy or specified revision
2246
2246
2247 With no revision, print a summary of the current state of the
2247 With no revision, print a summary of the current state of the
@@ -2263,7 +2263,7 b' def identify(ui, repo, source=None,'
2263 "(.hg not found)"))
2263 "(.hg not found)"))
2264
2264
2265 hexfunc = ui.debugflag and hex or short
2265 hexfunc = ui.debugflag and hex or short
2266 default = not (num or id or branch or tags)
2266 default = not (num or id or branch or tags or bookmarks)
2267 output = []
2267 output = []
2268
2268
2269 revs = []
2269 revs = []
@@ -2277,9 +2277,9 b' def identify(ui, repo, source=None,'
2277 rev = revs[0]
2277 rev = revs[0]
2278 if not rev:
2278 if not rev:
2279 rev = "tip"
2279 rev = "tip"
2280 if num or branch or tags:
2280 if num or branch or tags or bookmarks:
2281 raise util.Abort(
2281 raise util.Abort(_("can't query remote revision number,"
2282 _("can't query remote revision number, branch, or tags"))
2282 " branch, tags, or bookmarks"))
2283 output = [hexfunc(repo.lookup(rev))]
2283 output = [hexfunc(repo.lookup(rev))]
2284 elif not rev:
2284 elif not rev:
2285 ctx = repo[None]
2285 ctx = repo[None]
@@ -2310,12 +2310,20 b' def identify(ui, repo, source=None,'
2310 if t:
2310 if t:
2311 output.append(t)
2311 output.append(t)
2312
2312
2313 # multiple bookmarks for a single parent separated by '/'
2314 bm = '/'.join(ctx.bookmarks())
2315 if bm:
2316 output.append(bm)
2317
2313 if branch:
2318 if branch:
2314 output.append(ctx.branch())
2319 output.append(ctx.branch())
2315
2320
2316 if tags:
2321 if tags:
2317 output.extend(ctx.tags())
2322 output.extend(ctx.tags())
2318
2323
2324 if bookmarks:
2325 output.extend(ctx.bookmarks())
2326
2319 ui.write("%s\n" % ' '.join(output))
2327 ui.write("%s\n" % ' '.join(output))
2320
2328
2321 def import_(ui, repo, patch1, *patches, **opts):
2329 def import_(ui, repo, patch1, *patches, **opts):
@@ -4460,8 +4468,9 b' table = {'
4460 ('n', 'num', None, _('show local revision number')),
4468 ('n', 'num', None, _('show local revision number')),
4461 ('i', 'id', None, _('show global revision id')),
4469 ('i', 'id', None, _('show global revision id')),
4462 ('b', 'branch', None, _('show branch')),
4470 ('b', 'branch', None, _('show branch')),
4463 ('t', 'tags', None, _('show tags'))],
4471 ('t', 'tags', None, _('show tags')),
4464 _('[-nibt] [-r REV] [SOURCE]')),
4472 ('B', 'bookmarks', None, _('show bookmarks'))],
4473 _('[-nibtB] [-r REV] [SOURCE]')),
4465 "import|patch":
4474 "import|patch":
4466 (import_,
4475 (import_,
4467 [('p', 'strip', 1,
4476 [('p', 'strip', 1,
@@ -240,3 +240,7 b' test summary'
240 commit: (clean)
240 commit: (clean)
241 update: 1 new changesets, 2 branch heads (merge)
241 update: 1 new changesets, 2 branch heads (merge)
242
242
243 test id
244
245 $ hg id
246 db815d6d32e6 tip Y/Z/x y
@@ -230,7 +230,7 b' Show all commands + options'
230 grep: print0, all, follow, ignore-case, files-with-matches, line-number, rev, user, date, include, exclude
230 grep: print0, all, follow, ignore-case, files-with-matches, line-number, rev, user, date, include, exclude
231 heads: rev, topo, active, closed, style, template
231 heads: rev, topo, active, closed, style, template
232 help:
232 help:
233 identify: rev, num, id, branch, tags
233 identify: rev, num, id, branch, tags, bookmarks
234 import: strip, base, force, no-commit, exact, import-branch, message, logfile, date, user, similarity
234 import: strip, base, force, no-commit, exact, import-branch, message, logfile, date, user, similarity
235 incoming: force, newest-first, bundle, rev, bookmarks, branch, patch, git, limit, no-merges, stat, style, template, ssh, remotecmd, insecure, subrepos
235 incoming: force, newest-first, bundle, rev, bookmarks, branch, patch, git, limit, no-merges, stat, style, template, ssh, remotecmd, insecure, subrepos
236 locate: rev, print0, fullpath, include, exclude
236 locate: rev, print0, fullpath, include, exclude
@@ -66,7 +66,7 b' pretxncommit and commit hooks can see bo'
66 test generic hooks
66 test generic hooks
67
67
68 $ hg id
68 $ hg id
69 pre-identify hook: HG_ARGS=id HG_OPTS={'branch': None, 'id': None, 'num': None, 'rev': '', 'tags': None} HG_PATS=[]
69 pre-identify hook: HG_ARGS=id HG_OPTS={'bookmarks': None, 'branch': None, 'id': None, 'num': None, 'rev': '', 'tags': None} HG_PATS=[]
70 warning: pre-identify hook exited with status 1
70 warning: pre-identify hook exited with status 1
71 [1]
71 [1]
72 $ hg cat b
72 $ hg cat b
@@ -62,10 +62,28 b' with remote http repo'
62 $ hg id http://localhost:$HGPORT1/
62 $ hg id http://localhost:$HGPORT1/
63 cb9a9f314b8b
63 cb9a9f314b8b
64
64
65 remote with rev number?
66
67 $ hg id -n http://localhost:$HGPORT1/
68 abort: can't query remote revision number, branch, tags, or bookmarks
69 [255]
70
65 remote with tags?
71 remote with tags?
66
72
67 $ hg id -t http://localhost:$HGPORT1/
73 $ hg id -t http://localhost:$HGPORT1/
68 abort: can't query remote revision number, branch, or tags
74 abort: can't query remote revision number, branch, tags, or bookmarks
75 [255]
76
77 remote with branch?
78
79 $ hg id -b http://localhost:$HGPORT1/
80 abort: can't query remote revision number, branch, tags, or bookmarks
81 [255]
82
83 remote with bookmarks?
84
85 $ hg id -B http://localhost:$HGPORT1/
86 abort: can't query remote revision number, branch, tags, or bookmarks
69 [255]
87 [255]
70
88
71 Make sure we do not obscure unknown requires file entries (issue2649)
89 Make sure we do not obscure unknown requires file entries (issue2649)
General Comments 0
You need to be logged in to leave comments. Login now