Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.9, 1.9.1, and 1.9.2

csinfo: support workingctx object

When you pass None as target value, csinfo shows information of
working directory using workingctx object.

Changeset d4085ecdbf3c

Parent 454581b90aaf

by Yuki KODAMA

Changes to one file · Browse files at d4085ecdbf3c Showing diff from parent 454581b90aaf Diff from another changeset...

 
101
102
103
104
 
105
 
 
106
107
108
109
110
111
112
113
114
115
116
 
118
119
120
121
122
123
124
125
 
240
241
242
243
 
244
245
246
 
101
102
103
 
104
105
106
107
108
109
110
111
112
113
 
 
114
115
116
 
118
119
120
 
 
121
122
123
 
238
239
240
 
241
242
243
244
@@ -101,16 +101,16 @@
  pass    def create_context(repo, target): - if repo is None or target is None: + if repo is None:   return None + if target is None: + return repo[None]   ctx = PatchContext(repo, target)   if ctx is None:   ctx = ChangesetContext(repo, target)   return ctx    def ChangesetContext(repo, rev): - if repo is None or rev is None: - return None   try:   ctx = repo[rev]   except (error.LookupError, error.RepoLookupError, error.RepoError): @@ -118,8 +118,6 @@
  return ctx    def PatchContext(repo, patchpath, cache={}): - if repo is None or patchpath is None: - return None   # check path   if not os.path.isabs(patchpath) or not os.path.isfile(patchpath):   return None @@ -240,7 +238,7 @@
  elif item == 'summary':   value = ctx.description().replace('\0', '').split('\n')[0]   if len(value) == 0: - return None + return None   return hglib.toutf(hglib.tounicode(value)[:80])   elif item == 'user':   return hglib.toutf(ctx.user())