Show More
@@ -116,6 +116,10 b' else:' | |||
|
116 | 116 | print "Unable to open repository" |
|
117 | 117 | sys.exit(0) |
|
118 | 118 | |
|
119 | relpath = None | |
|
120 | if os.getcwd() != repo.root: | |
|
121 | relpath = os.getcwd()[len(repo.root) + 1: ] | |
|
122 | ||
|
119 | 123 | if cmd == "checkout" or cmd == "co": |
|
120 | 124 | node = repo.changelog.tip() |
|
121 | 125 | if args: |
@@ -174,6 +178,9 b' elif cmd == "import" or cmd == "patch":' | |||
|
174 | 178 | |
|
175 | 179 | elif cmd == "status": |
|
176 | 180 | (c, a, d) = repo.diffdir(repo.root, repo.current) |
|
181 | if relpath: | |
|
182 | (c, a, d) = map(lambda x: filterfiles(x, [ relpath ]), (c, a, d)) | |
|
183 | ||
|
177 | 184 | for f in c: print "C", f |
|
178 | 185 | for f in a: print "?", f |
|
179 | 186 | for f in d: print "R", f |
@@ -192,8 +199,7 b' elif cmd == "diff":' | |||
|
192 | 199 | print "too many revisions to diff" |
|
193 | 200 | sys.exit(1) |
|
194 | 201 | |
|
195 | if os.getcwd() != repo.root: | |
|
196 | relpath = os.getcwd()[len(repo.root) + 1: ] | |
|
202 | if relpath: | |
|
197 | 203 | if not args: args = [ relpath ] |
|
198 | 204 | else: args = [ os.path.join(relpath, x) for x in args ] |
|
199 | 205 | |
@@ -248,7 +254,11 b' elif cmd == "history":' | |||
|
248 | 254 | print changes[4] |
|
249 | 255 | |
|
250 | 256 | elif cmd == "log": |
|
251 | if args: | |
|
257 | ||
|
258 | if len(args) == 1: | |
|
259 | if relpath: | |
|
260 | args[0] = os.path.join(relpath, args[0]) | |
|
261 | ||
|
252 | 262 | r = repo.file(args[0]) |
|
253 | 263 | for i in range(r.count()): |
|
254 | 264 | n = r.node(i) |
@@ -261,6 +271,14 b' elif cmd == "log":' | |||
|
261 | 271 | print "changeset: %4d:%s" % (cr, cn) |
|
262 | 272 | print "parents: %4d:%s" % (i1, h1) |
|
263 | 273 | if i2: print " %4d:%s" % (i2, h2) |
|
274 | changes = repo.changelog.read(repo.changelog.node(cr)) | |
|
275 | print "user: %s date: %s" % (changes[1], time.asctime( | |
|
276 | time.localtime(float(changes[2].split(' ')[0])))) | |
|
277 | print "description:" | |
|
278 | print changes[4] | |
|
279 | ||
|
280 | elif len(args) > 1: | |
|
281 | print "too many args" | |
|
264 | 282 | else: |
|
265 | 283 | print "missing filename" |
|
266 | 284 |
General Comments 0
You need to be logged in to leave comments.
Login now