comparison mercurial/commands.py @ 6739:c9fbd6ec3489

context: avoid using None for working parent
author Matt Mackall <mpm@selenic.com>
date Wed, 25 Jun 2008 17:35:20 -0500
parents 1fe6f365df2e
children b148e9099133
comparison
equal deleted inserted replaced
6738:336fda65759a 6739:c9fbd6ec3489
187 before starting the backout, then merges the new head with that 187 before starting the backout, then merges the new head with that
188 changeset afterwards. This saves you from doing the merge by 188 changeset afterwards. This saves you from doing the merge by
189 hand. The result of this merge is not committed, as for a normal 189 hand. The result of this merge is not committed, as for a normal
190 merge. 190 merge.
191 191
192 See 'hg help dates' for a list of formats valid for -d/--date. 192 See \'hg help dates\' for a list of formats valid for -d/--date.
193 ''' 193 '''
194 if rev and node: 194 if rev and node:
195 raise util.Abort(_("please specify just one revision")) 195 raise util.Abort(_("please specify just one revision"))
196 196
197 if not rev: 197 if not rev:
2668 changestates = zip(states, 'MAR!?IC', stat) 2668 changestates = zip(states, 'MAR!?IC', stat)
2669 2669
2670 if (opts['all'] or opts['copies']) and not opts['no_status']: 2670 if (opts['all'] or opts['copies']) and not opts['no_status']:
2671 ctxn = repo.changectx(nullid) 2671 ctxn = repo.changectx(nullid)
2672 ctx1 = repo.changectx(node1) 2672 ctx1 = repo.changectx(node1)
2673 ctx2 = repo.changectx(node2)
2674 added = stat[1] 2673 added = stat[1]
2675 if node2 is None: 2674 if node2 is None:
2676 added = stat[0] + stat[1] # merged? 2675 added = stat[0] + stat[1] # merged?
2677 ctx2 = repo.workingctx() 2676 ctx2 = repo.workingctx()
2677 else:
2678 ctx2 = repo.changectx(node2)
2678 for k, v in copies.copies(repo, ctx1, ctx2, ctxn)[0].items(): 2679 for k, v in copies.copies(repo, ctx1, ctx2, ctxn)[0].items():
2679 if k in added: 2680 if k in added:
2680 copy[k] = v 2681 copy[k] = v
2681 elif v in added: 2682 elif v in added:
2682 copy[v] = k 2683 copy[v] = k
2711 shared among repositories). 2712 shared among repositories).
2712 2713
2713 See 'hg help dates' for a list of formats valid for -d/--date. 2714 See 'hg help dates' for a list of formats valid for -d/--date.
2714 """ 2715 """
2715 2716
2716 rev_ = None 2717 rev_ = "."
2717 names = (name1,) + names 2718 names = (name1,) + names
2718 if len(names) != len(dict.fromkeys(names)): 2719 if len(names) != len(dict.fromkeys(names)):
2719 raise util.Abort(_('tag names must be unique')) 2720 raise util.Abort(_('tag names must be unique'))
2720 for n in names: 2721 for n in names:
2721 if n in ['tip', '.', 'null']: 2722 if n in ['tip', '.', 'null']: