Commits

Anonymous committed 681ae00

updates to newly created task even when -r specified with auto.track.new
user will be warned if the update fails but the task creation succeeds
refs #9

  • Participants
  • Parent commits 9f0a127

Comments (0)

Files changed (1)

File hgext/tasks.py

         write(ui, repo, tasks)
 
         # handle the auto tracking of newly created tasks on current node
-        if not rev and ui.configbool('tasks', 'auto.track.new'):
-            opts = {'rev':None, 'clean':False, 'date':None }
-            tasksupdate(commands.update, ui, repo, *[ task ], **opts)
+        if ui.configbool('tasks', 'auto.track.new'):
+            try:
+                opts = {'rev':None, 'clean':False, 'date':None }
+                tasksupdate(commands.update, ui, repo, *[ task ], **opts)
+            except Exception, exception:
+                raise type(exception)( str(exception)
+                    + "\nwarning: new task '%s' created but not set to current"
+                    %task)
         return
 
     # list tasks